Skip to content

Commit 6daba64

Browse files
Some more comments.
1 parent 6513d33 commit 6daba64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sdk/Notifo.SDK/NotifoMobilePush/TrackSeenCommand.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal sealed class TrackSeenCommand : ICommand
2020
[Obsolete]
2121
public HashSet<Guid> Ids
2222
{
23+
// Convert the old IDs to the new dictionary, so that we can read old commands from the disk.
2324
set => IdsAndUrls = value.ToDictionary(x => x, x => (string?)null);
2425
}
2526

@@ -32,8 +33,10 @@ public async ValueTask ExecuteAsync(
3233
{
3334
try
3435
{
36+
// The notifo based app might receive notifications even though the API key is not configured.
3537
if (!NotifoIO.Current.IsConfigured)
3638
{
39+
// Then we have to fallback to URLs.
3740
await TrackWithUrlsAsync(ct);
3841
}
3942
else
@@ -53,6 +56,7 @@ private async Task TrackWithUrlsAsync(
5356
{
5457
var urls = IdsAndUrls.Values.Where(x => x != null).ToList();
5558

59+
// If some IDs do not have an URL, we create an error, because this should only happen for old commands.
5660
if (urls.Count < IdsAndUrls.Count)
5761
{
5862
NotifoIO.Current.RaiseError(Strings.TrackingURLMissing, null, this);
@@ -63,7 +67,7 @@ private async Task TrackWithUrlsAsync(
6367
return;
6468
}
6569

66-
var httpClient = NotifoIO.Current.CreateHttpClient();
70+
using var httpClient = NotifoIO.Current.CreateHttpClient();
6771

6872
foreach (var url in urls)
6973
{

0 commit comments

Comments
 (0)