Skip to content

Commit 815c563

Browse files
perf(audience): move SyncConsentToBackend out of _initLock
Fires the fire-and-forget consent PUT after the lock releases. JSON serialisation, dictionary allocation, and Task.Run scheduling no longer block concurrent SetConsent / Identify / Reset callers. Why: the call's three args are already local snapshots and the control client it reads is not _initLock-protected anyway (Shutdown disposes it without the lock, relying on _shutdownCancellationSource for safety). Tests: all 181 audience unit tests pass. No test changes — Identity.Reset still runs before the PUT, so the revocation regression guard still holds. Addresses Cursor Bugbot comment on #700. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 59902df commit 815c563

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Packages/Audience/Runtime/ImmutableAudience.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ public static void SetConsent(ConsentLevel level)
489489

490490
newSession?.Start();
491491

492+
492493
SyncConsentToBackend(config, level, anonymousIdForPut);
493494
}
494495

0 commit comments

Comments
 (0)