Skip to content

Commit

Permalink
Set priorities for some TODOs. HomePage counts to 0 if unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
edeykholt committed Aug 13, 2024
1 parent d752631 commit 38806b3
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions KeriAuth.BrowserExtension.Tests/Helper/UrlBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void CreateUrlWithEncodedQueryStrings_EncodesQueryParamsCorrectly()
var queryParams = new List<KeyValuePair<string, string>>
{
new("key1", "value1"),
// TODO adjust code so this test passes
// TODO P3 adjust code so this test passes
// new("key2", "value with space"),
// new("key3", "value&with&special"),
// new("key&with&special", "value&with&special")
Expand All @@ -33,7 +33,7 @@ public void CreateUrlWithEncodedQueryStrings_EncodesQueryParamsCorrectly()
// Assert.Contains("key%26with%26special=value%26with%26special", result);
}

/* /* TODO adjust code so this test passes
/* /* TODO P3 adjust code so this test passes
[Fact]
public void CreateUrlWithEncodedQueryStrings_HandlesEmptyQueryParams()
{
Expand Down Expand Up @@ -64,7 +64,7 @@ public void DecodeUrlQueryString_DecodesQueryParamsCorrectly()
Assert.Equal("value&with&special", result["key&with&special"]);
}

/* TODO adjust code so this test passes
/* TODO P3 adjust code so this test passes
[Fact]
public void DecodeUrlQueryString_ThrowsExceptionOnNullValue()
{
Expand All @@ -77,7 +77,7 @@ public void DecodeUrlQueryString_ThrowsExceptionOnNullValue()
}
*/

/* TODO adjust code so this test passes
/* TODO P3 adjust code so this test passes
[Fact]
public void DecodeUrlQueryString_ReturnsEmptyDictionaryForNoQueryParams()
{
Expand Down
2 changes: 1 addition & 1 deletion KeriAuth.BrowserExtension/Helper/JSInteropHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace KeriAuth.BrowserExtension.Helper
{
public class JSInteropHelper(IJSRuntime jsRuntime)
{
// TODO set shorter timeout depending on #debug
// TODO P3 set shorter timeout depending on #debug

#if DEBUG
private static readonly TimeSpan DefaultTimeout = TimeSpan.FromMilliseconds(22222000);
Expand Down
2 changes: 1 addition & 1 deletion KeriAuth.BrowserExtension/Models/Website.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public enum AutoSignInMode

public record WebsiteInteraction
{
// TODO: Implement this record
// TODO P2: Implement this record
// RequestingTabId
// RequestingOrigin
// RequestedAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task SendToServiceWorkerAsync<T>(string message, T payload)
{
if (_port != null)
{
// TODO make the message payload typed
// TODO P2 make the message payload typed
//var messagePayload = new MessagePayload<T>
//{
// Message = message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void Initialize(Uri uri, string contextType)
InitialUriQuery = query;
if (uri.AbsoluteUri.Contains("chrome-extension"))
{
// TODO: better to get this environment value from the chrome.runtime.getContexts() API, filtered by the current context. See UIHelper.GetChromeContexts()
// TODO P3: better to get this environment value from the chrome.runtime.getContexts() API, filtered by the current context. See UIHelper.GetChromeContexts()
if (QueryHelpers.ParseQuery(query).TryGetValue("environment", out var environment))
{
if (Enum.TryParse(environment.FirstOrDefault(), true, out ExtensionEnvironment extensionEnvironment))
Expand Down
4 changes: 2 additions & 2 deletions KeriAuth.BrowserExtension/Services/HttpClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class HttpClientService
public HttpClientService(HttpClient httpClient)
{
_httpClient = httpClient;
logger = new Logger<HttpClientService>(new LoggerFactory()); // TODO: insert via DI
logger = new Logger<HttpClientService>(new LoggerFactory()); // TODO P4: insert via DI

// Define a timeout policy that times out after 2 seconds.
var timeoutDuration = TimeSpan.FromSeconds(2);
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task<Result<TResponse>> SendAsync<TRequest, TResponse>(HttpMethod m

public async Task<Result<HttpResponseMessage>> GetJsonAsync<TResponse>(string url)
{
TimeSpan timeout = TimeSpan.FromSeconds(3); // TODO. Consider making this configurable and also providing an external cts source. Apply pattern elsewhere.
TimeSpan timeout = TimeSpan.FromSeconds(3); // TODO P2. Consider making this configurable and also providing an external cts source. Apply pattern elsewhere.
HttpResponseMessage httpResponseMessage;
using var cts = new CancellationTokenSource(timeout);
try
Expand Down
4 changes: 2 additions & 2 deletions KeriAuth.BrowserExtension/Services/IdentifiersService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public async Task<Result<List<IdentifierHeadline>>> GetIdentifierHeadlines()
//// logger.LogWarning("GetIdentifierHeadlines: GetIdentifierService salty {1}", (object)aid.Salty);
//logger.LogWarning("GetIdentifierHeadlines: GetIdentifierService transferable {1}", aid.Transferable);
//// logger.LogWarning("GetIdentifierHeadlines: GetIdentifierService windexes {1}", (object)aid.Windexes);
//// TODO !! parse?
//// TODO P4 parse?


// TODO ?? set the current identifierService in the Headline?
// TODO P3 set the current identifierService in the Headline?
var identifierService = new IdentifierService(item.Prefix, item.Name, Guid.NewGuid(), logger, storageService);
headlines.Add(new IdentifierHeadline(item.Prefix, identifierService.cachedAid.Alias, Guid.NewGuid()));
}
Expand Down
2 changes: 1 addition & 1 deletion KeriAuth.BrowserExtension/Services/PreferencesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PreferencesService(IStorageService storageService, ILogger<Preferen

public void Initialize()
{
stateSubscription = storageService.Subscribe(this); // TODO consider using parameters for onNext, etc.
stateSubscription = storageService.Subscribe(this);
}

public async Task<Preferences> GetPreferences()
Expand Down
2 changes: 1 addition & 1 deletion KeriAuth.BrowserExtension/Services/StateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task NotifyObservers()
{
foreach (var observer in stateObservers)
observer.OnNext(stateMachine.State);
await Task.Delay(0); // hack
await Task.Delay(0);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions KeriAuth.BrowserExtension/Services/StorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<Task> Initialize()
logger.Log(ServiceLogLevel, "Registering handler for storage change event");

// Set up to listen for storage changes. Could alternately have implemented this in the background script and/or https://github.com/mingyaulee/WebExtensions.Net
// TODO investigate using https://github.com/mingyaulee/WebExtensions.Net
// TODO P2 investigate using https://github.com/mingyaulee/WebExtensions.Net
IJSObjectReference _module = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "/scripts/es6/storageHelper.js");
await _module.InvokeVoidAsync("addStorageChangeListener", _dotNetObjectRef);
}
Expand Down Expand Up @@ -404,7 +404,7 @@ public async Task NotifyStorageChanged(Dictionary<string, Dictionary<string, Jso
observer.OnNext(preferences);
}
}
// TODO ALSO handle notifying subscribers for other keys
// TODO P3 ALSO handle notifying subscribers for other keys
}
break;
case "sync":
Expand Down
10 changes: 5 additions & 5 deletions KeriAuth.BrowserExtension/UI/Pages/HomePage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,31 @@
<MudText Style="width:200px; text-align:right;">
<MudLink OnClick="() => navManager.NavigateTo(AppConfig.RouteToCredentials)">Credentials</MudLink>
</MudText>
<MudText Style="width:135px; text-align:left;">5</MudText>
<MudText Style="width:135px; text-align:left;">0</MudText>
</MudStack>
<MudStack Row>
<MudText Style="width:200px; text-align:right;">
<MudLink OnClick="() => navManager.NavigateTo(AppConfig.RouteToIdentifier)">Multi-Sig Groups</MudLink>
</MudText>
<MudText Style="width:135px; text-align:left;">1</MudText>
<MudText Style="width:135px; text-align:left;">0</MudText>
</MudStack>
<MudStack Row>
<MudText Style="width:200px; text-align:right;">
<MudLink OnClick="() => navManager.NavigateTo(AppConfig.RouteToIdentifier)">Configured Websites</MudLink>
</MudText>
<MudText Style="width:135px; text-align:left;">4</MudText>
<MudText Style="width:135px; text-align:left;">0</MudText>
</MudStack>
<MudStack Row>
<MudText Style="width:200px; text-align:right;">
<MudLink OnClick="() => navManager.NavigateTo(AppConfig.RouteToIdentifiers)">KERI Agent Requests</MudLink>
</MudText>
<MudText Style="width:135px; text-align:left;">2</MudText>
<MudText Style="width:135px; text-align:left;">0</MudText>
</MudStack>
<MudStack Row>
<MudText Style="width:200px; text-align:right;">
<MudLink OnClick="() => navManager.NavigateTo(AppConfig.RouteToIdentifiers)">Notifications</MudLink>
</MudText>
<MudText Style="width:135px; text-align:left;">1</MudText>
<MudText Style="width:135px; text-align:left;">0</MudText>
</MudStack>
</MudStack>
</MudStack>
Expand Down

0 comments on commit 38806b3

Please sign in to comment.