feat(phase-16.3): light up anonId unique-listener layer

Mint a first-party localStorage anonId, thread it onto play/share beacons,
persist it via EventController, and add all-time distinct-listener counts
(site/track/release). Storage columns + indexes already existed from 16.1.
This commit is contained in:
daniel-c-harvey
2026-06-19 14:37:55 -04:00
parent ebbaa3f84f
commit c084efa78e
16 changed files with 680 additions and 12 deletions
+13 -1
View File
@@ -34,12 +34,24 @@ public class ShareTrackerTests
protected override void NavigateToCore(string uri, bool forceLoad) { }
}
// Fixed-value anon-id provider so the tracker can attach a token without JS interop. Treated as
// already warmed (Current returns the value); EnsureLoadedAsync is a no-op here.
private sealed class StubAnonIdProvider : IAnonIdProvider
{
public StubAnonIdProvider(string? current) => Current = current;
public string? Current { get; }
public ValueTask EnsureLoadedAsync() => ValueTask.CompletedTask;
}
private ShareTracker _tracker = null!;
private readonly DateTimeOffset _t0 = new(2026, 6, 19, 12, 0, 0, TimeSpan.Zero);
[SetUp]
public void SetUp()
=> _tracker = new ShareTracker(new BeaconInterop(new NoopJsRuntime()), new TestNavigationManager());
=> _tracker = new ShareTracker(
new BeaconInterop(new NoopJsRuntime()),
new StubAnonIdProvider("anon-1"),
new TestNavigationManager());
// A copy-link records one share with channel = link.
[Test]