[Reliability] Keep crash-report user identity current - #149
Draft
joashrajin wants to merge 1 commit into
Draft
joashrajin wants to merge 1 commit into
joashrajin wants to merge 1 commit into
Conversation
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.
Fix
Crash logging initializes before
Simplenoteconstructs Simperium. The existing user flow samplesapp.simperium.useronce and completes, while Simperium restores only its access token and email—not a user ID.An authenticated cold start can therefore remain anonymous in crash reporting, and later sign-in or sign-out changes
are not reflected.
Observe Simperium's credential preferences for the lifetime of the crash-logging collector. Each initial or changed
signal reads both values from one preference snapshot, emits an email-only user when the token and email are both
nonblank, coalesces the two callbacks from one authentication update, and clears the user when the credentials
disappear. Reading the snapshot downstream also prevents a concurrent login callback from being overwritten by an
older initial value. The access token is only a session-presence check and is never sent to crash logging.
This changes crash-report identity metadata only. Authentication, credential persistence, sync, and the existing
analytics setting and crash-event gating are unchanged.
Test
96ba297a81348f032e6d0730c70e44ca5af683131f0fa27e8f9dc918a94d1069) against exact forktrunka1280c2eand the fix:expected locally.
SENTRY_AUTH_TOKENwas unset.:Simplenote:lintDebug: 0 errors, 263 warnings, 1 hint, with no findings on either changed path.Review
Please focus on the preference-listener lifetime and cleanup, the single-snapshot read under concurrent initial/login
ordering, and the token's presence-only role.
The tests use mocked preferences and the crash-logging data provider. They do not initialize a real Sentry client,
contact a crash backend, execute a real Simperium authentication flow, run on a device, or change/test crash-report
consent behavior.
Before publication, neither changed path appeared in any of 118 open fork PRs or 9 open upstream PRs. This branch is
based directly on fork
trunk; no upstream branch or PR was written.Release
Release notes are not needed; this is diagnostics reliability hardening.