Repository navigation
feat: [SDK-5538] deferred managers that stand in before init - #2802
Draft
abdulraqeeb33 wants to merge 1 commit into
Draft
abdulraqeeb33 wants to merge 1 commit into
abdulraqeeb33 wants to merge 1 commit into
Conversation
Deferred User, Notifications, InAppMessages, Session and Location managers, plus JWT invalidated listeners. Every call re-resolves the real manager through a ManagerSource. Before init, registrations are queued (a removal cancels its queued add, a setting keeps its latest value) and replayed in order once; other calls are logged and dropped. Not wired in yet; OneSignalImpV2 hands these out later in this stack. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Deferred managers that stand in for
User,Notifications,InAppMessages,Session,Locationand the JWT listeners before init succeeds.Details
Motivation
Part of SDK-5538. Today every accessor throws before init. PR 4 hands these out instead, so calls before init log rather than crash.
Scope
ManagerSource, so a reference captured before init (for example through dependency injection) works after init or after a retry.InAppMessages.pausedandLocation.isShared.pausedandisSharedgetters return the queued value.requestPermission) suspend on init instead of blocking.Testing
Unit testing
DeferredManagersTests: for every manager, non-registration calls are ignored before ready and forward after; registrations queue and replay in order, once; a removal cancels its queued add; a setting keeps its latest value and reads back; suspend members await; a failing replayed call does not stop the rest. All suites, spotless, detekt and apiCheck pass.Manual testing
Not needed, not wired in.
Affected code checklist
Checklist
Overview
Testing
Final pass