Repository navigation
feat: [SDK-5538] remote kill switch with a placeholder OneSignalImpV2 - #2801
Draft
abdulraqeeb33 wants to merge 1 commit into
Draft
abdulraqeeb33 wants to merge 1 commit into
abdulraqeeb33 wants to merge 1 commit into
Conversation
NeverCrashKillSwitch reads the feature flags cached by the previous run at process start (ActivityLifecycleInitializer) and picks the IOneSignal implementation once per process: sdk_never_crash_disabled present means OneSignalImp, otherwise OneSignalImpV2. A fresh install, a locked device, an unreadable cache, or first use before evaluation keep OneSignalImpV2. OneSignalImpV2 is a verbatim copy of OneSignalImp for now, so behavior is unchanged either way. The never-crash init lands on it later in this stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)139/430 touched executable lines covered (32.3% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 32.3% (minimum 80%). |
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.
Stack (base
feat/never-crash, merged tomainas one unit; split out of #2793):Description
One Line Summary
A remote kill switch that picks the
IOneSignalimplementation at process start, withOneSignalImpV2as a placeholder copy ofOneSignalImp.Details
Motivation
Part of SDK-5538. The never-crash init (PR 4) rewrites init, so it ships behind a flag that can bring back the old implementation without a release.
Scope
NeverCrashKillSwitchreads the feature flags cached by the previous run fromActivityLifecycleInitializer(androidx.startup, beforeApplication.onCreate), once per process. A backend change applies on the next cold start.sdk_never_crash_disabledin the cachedsdkRemoteFeatureFlags(any casing) selectsOneSignalImp; otherwiseOneSignalImpV2.OneSignalImpV2.OneSignalcreates its implementation through the switch.OneSignalImpV2is a verbatim copy ofOneSignalImp(only the class name differs), so behavior is unchanged either way. PR 4's diff on it then reads as the change from the old code.localOverrideinNeverCrashKillSwitchforces either implementation for local testing.Known gaps (follow-ups)
OneSignalprefs file on the main thread beforeApplication.onCreate.OneSignalImpV2.Testing
Unit testing
NeverCrashKillSwitchTests: the flag selectsOneSignalImpin any casing; no flag, a fresh install, an unreadable cache, a locked device and first use before evaluation selectOneSignalImpV2. All suites, spotless, detekt and apiCheck pass.Manual testing
Not yet tested on a device.
Affected code checklist
Checklist
Overview
Testing
Final pass