fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock - #2
Open
kapeeshUp wants to merge 4 commits into
Conversation
…rtup deadlock +[AWSPinpointNotificationManager isNotificationEnabled] dispatch_sync'd to the main thread. When called from AWSPinpointEventRecorder submitAllEvents (which holds the recorder lock) on a background thread while the main thread is blocked on that same lock in SKZCognitoManager trackEvent -> submitAllEvents, the two threads deadlock permanently. Publisher-visible symptom: portal loading screen frozen at 95% (deterministic repro: start match -> background -> force-quit -> relaunch via deep link; confirmed by publisher kernel stackshots). isRegisteredForRemoteNotifications is a main-thread-only API, so instead of blocking, cache its value: read live on the main thread, return the cached value off-main, refresh on app foreground and push-token registration. Only consumer is the analytics endpoint optOut field (AWSPinpointEndpointProfile setEndpointOptOut) - transient staleness there is the entire behavior delta. Also fixes the same latent deadlock reachable via recorder init (AWSPinpointEventRecorder initWithContext -> currentEndpointProfile) and off-main updateEndpointProfile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…in reads Stale-while-revalidate: every off-main isNotificationEnabled read now returns the cached value immediately AND schedules a main-thread refresh (coalesced to one in-flight task via a pending flag), instead of priming only once. Shrinks the worst-case staleness window to one main-runloop pass after any background read, with no blocking anywhere. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…o eliminate startup deadlock Replaces the caching approach (9c1b7be, 10cbfe9) with removal at the source, per review: setEndpointOptOut no longer consults +[AWSPinpointNotificationManager isNotificationEnabled], whose dispatch_sync-to-main under the event-recorder lock caused the deterministic portal-frozen-at-95% startup deadlock. AWSPinpointNotificationManager.m is reverted to pristine upstream; the method simply has no callers now. Impact audit: Skillz never wires Pinpoint push campaigns (no interceptor call sites outside the AWS lib), nothing client-side branches on optOut, and the endpoint payload shape is unchanged - optOut now reflects only the application-level opt-out configuration (constant NONE for Skillz). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Check points:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.