Skip to content

fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock - #2

Open
kapeeshUp wants to merge 4 commits into
skillz-masterfrom
fix/pinpoint-isnotificationenabled-nonblocking
Open

fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock#2
kapeeshUp wants to merge 4 commits into
skillz-masterfrom
fix/pinpoint-isnotificationenabled-nonblocking

Conversation

@kapeeshUp

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

Check points:

  • Added new tests to cover change, if needed
  • All unit tests pass
  • All integration tests pass
  • Updated CHANGELOG.md
  • Documentation update for the change if required
  • PR title conforms to conventional commit style

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

kapeeshUp and others added 2 commits August 18, 2026 17:12
…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>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 13d629f7-12e3-4491-87e5-1e9bd0dcdf54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

kapeeshUp and others added 2 commits August 19, 2026 18:10
…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>
@kapeeshUp kapeeshUp changed the title Fix/pinpoint isnotificationenabled nonblocking #2 (aws-sdk-ios): fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock Aug 19, 2026
@kapeeshUp kapeeshUp changed the title #2 (aws-sdk-ios): fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock fix(pinpoint): remove push-registration lookup from endpoint optOut to eliminate startup deadlock Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant