fix(android): Backfill pre-init ANR and native crash metadata (#5762)
* fix(android): Backfill exit options when app is unchanged Use current options when persisted values are missing and the app has not been updated since the exit. Avoid attributing historical crashes to a newer app version. * changelog * fix(android): Backfill app context for historical exits Populate app version and build for historical ANR and native crash events when the current package metadata is safe to use. Co-Authored-By: Codex <noreply@openai.com> * fix(android): Limit historical app metadata backfill Backfill only app version and build for historical exits. Avoid attaching current localized app names, identifiers, or split APK state to older events. Co-Authored-By: Codex <noreply@openai.com> * fix(android): Reject unknown exit timestamps Do not use current SDK options when an exit timestamp is unavailable because an intervening app update cannot be ruled out. Co-Authored-By: Codex <noreply@openai.com> * fix(android): Validate persisted options cache generation Persist the app update timestamp after writing the options snapshot. Trust cached release, environment, and dist only when the marker identifies the current app installation, preserving launch-specific values without leaking stale metadata across app updates. Co-Authored-By: Codex <noreply@openai.com> * fix(android): Validate launch-specific cached options Apply the app-generation marker when selecting option tags and the replay-on-error sample rate. Preserve values from the crashed launch within one app version while rejecting stale values after an update. Co-Authored-By: Codex <noreply@openai.com> * docs(android): Explain options cache marker ordering Document why the generation observer uses its release callback only after the options cache has been fully persisted. Co-Authored-By: Codex <noreply@openai.com> * fix(android): Validate exit option cache sources Reject option caches created after an exit and keep immutable build metadata aligned with the event's app generation. This prevents intermediate releases and stale ProGuard or SDK metadata from being attached to historical exits. Co-Authored-By: Codex <noreply@openai.com> * style(android): Annotate nullable app context Co-Authored-By: OpenAI Codex <noreply@openai.com> * docs(android): Explain options cache generation observer Clarify why the observer is ordered after option persistence and update the changelog to describe the generation-aware behavior. Co-Authored-By: OpenAI Codex <noreply@openai.com> * docs(android): Add cache generation example Document the same-build, account-specific options scenario that requires preferring a matching persisted snapshot. Co-Authored-By: OpenAI Codex <noreply@openai.com> * ref(android): Reuse cache utilities for generation marker Expose cache serialization helpers as internal API and use them for the Android options cache generation marker. Co-Authored-By: OpenAI Codex <noreply@openai.com> * docs(android): Explain exit option selection Document how launch options, build metadata, and cache generations are selected for application exit events. Co-Authored-By: OpenAI Codex <noreply@openai.com> * docs: Move changelog entry to Unreleased Keep PR #5762 out of the already released 8.49.0 section. Co-Authored-By: Codex <noreply@openai.com> --------- Co-authored-by: Codex <noreply@openai.com>
R
Roman Zavarnitsyn committed
031ec336fb2ecc9c057d02fd60d4979eee095824
Parent: 455eb6e
Committed by GitHub <noreply@github.com>
on 7/17/2026, 10:43:31 AM