Repository navigation
fix: ignore login, logout and JWT calls before init instead of throwing - #2829
Draft
fadi-george wants to merge 1 commit into
Draft
fadi-george wants to merge 1 commit into
fadi-george wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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)12/21 touched executable lines covered (57.1% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 57.1% (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.
Description
One Line Summary
login,logout,updateUserJwtand the JWT listener calls log and return instead of throwing when init never started or failed.Details
Motivation
A simpler alternative to the never-crash stack (#2800 to #2828) for the most common crash: calling
loginand friends beforeinitWithContext, or after it failed. It reuses the existing init state andwaitForInitinstead of adding a new gate, deferred managers or a kill switch.Scope
NOT_STARTED) or after a failed init (FAILED), these calls log'<op>' ignored: ...with the init failure attached and return:login,logout,updateUserJwt,add/removeUserJwtInvalidatedListener,loginSuspend,logoutSuspend,updateUserJwtSuspend.loginstill returnsNOT_INITIALIZED, now through the same helper.IN_PROGRESS, calls still block until it finishes, same as today.Not in this PR:
User,Notifications,InAppMessages,Location,Session) still throw before init. They need something to return, so they are a follow-up.initWithContextparams, separate change.Testing
Unit testing
Updated the "throws before init" tests to assert the calls are ignored, and added coverage for the
FAILEDstate and the JWT listeners. The full core unit test suite, spotless, detekt and apiCheck pass.lintReleasereports 5 errors in files this PR does not touch (BackgroundManager,DatabaseCursor).Manual testing
Not done yet.
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code