Merged
Conversation
24138f3 to
e840708
Compare
Collaborator
Author
e9019ab to
b64ffc5
Compare
b4b6d41 to
366129b
Compare
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.
Changes in this pull request
Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues.Greptile Summary
This PR refactors
ConfigManagerinto aSequentialActor-based system, moving all state-mutation logic into typedActions/Updatessealed classes insideConfigState. It also renamesTestModeManager→TestMode, absorbs the activation UI flow into that class, fixes thethenIfboolean-guard bug, and ships a largeConfigManagerTestsuite.ConfigManager.reevaluateTestModeis a plainfuncalled from theIdentityManagerActorqueue; it mutatesTestMode.stateconcurrently withConfigState.Actions.ApplyConfig(which runs on the config actor queue), creating an unsynchronized write-write race on the unguardedvar state.Confidence Score: 4/5
Mostly safe to merge; one concurrency issue in reevaluateTestMode should be addressed to prevent rare but real test-mode state corruption.
A single P1 data race on TestMode.state between two independent actor queues caps the score at 4. The rest of the changes are well-structured, well-tested, and address prior review feedback.
superwall/src/main/java/com/superwall/sdk/config/ConfigManager.kt (reevaluateTestMode) and superwall/src/main/java/com/superwall/sdk/store/testmode/TestMode.kt (unsynchronized state var)
Important Files Changed
Sequence Diagram
sequenceDiagram participant I as IdentityManagerActor participant S as SdkContext participant CM as ConfigManager participant A as SequentialActor (Config) participant TM as TestMode Note over I,TM: Config fetch path (inside actor) CM->>A: immediate(FetchConfig) A->>A: network.getConfig() A->>A: immediate(ApplyConfig) A->>TM: evaluateTestMode() [inside actor queue] TM-->>TM: state = Active/Inactive Note over I,TM: Identity change path (outside actor, concurrent) I->>S: reevaluateTestMode(appUserId, aliasId) S->>CM: reevaluateTestMode(...) CM->>TM: evaluateTestMode() [outside actor queue] TM-->>TM: state = Active/Inactive Note over A,TM: Race: both paths write TestMode.state concurrentlyPrompt To Fix All With AI
Reviews (2): Last reviewed commit: "Merge branch 'develop' into ir/refactor/..." | Re-trigger Greptile