Repository navigation
mobile: the App listener's rejection reaches the catch - #408
Open
kurktchiev wants to merge 1 commit into
Open
kurktchiev wants to merge 1 commit into
kurktchiev wants to merge 1 commit into
Conversation
initReminderSync and onAppActive both dropped the promise App.addListener returns inside a block body, so when the App plugin is not behind the bridge (Capacitor's proxy rejects with UNIMPLEMENTED) the existing .catch never saw it and every boot raised an unhandled rejection. The arrow returns it now. Reproduced with a plain rejecting object: a vi.fn cannot, because vitest attaches its own handlers to every promise a spy returns, which counts as handling it and would hide exactly this leak. frontend 2 new tests, run against the old code first to confirm they fail there (both did, with the plugin's rejection message), then against the fix (both pass). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
initReminderSyncandonAppActiveboth dropped the promiseApp.addListenerreturns inside a block body:When the App plugin isn't behind the bridge (a native project whose Capacitor
cap sync never ran, or a custom platform),
addListenerrejects(
UNIMPLEMENTED), and since the arrow's block body never returns thatpromise, the
.catch()right behind it never sees it. Every boot raised anunhandled rejection.
Both are one-line fixes that return the promise instead of dropping it.
frontend 2 new tests in
mobile.listener.test.js, run withnpx vitest run --maxWorkers=2. They use a plain rejecting object standing in for the Appplugin rather than a
vi.fn, because a spy attaches its own handlers to everypromise it returns, which counts as handling it and would hide this exact
leak. Checked against the old code first (both tests failed, catching the
plugin's rejection message as an unhandled rejection), then against the fix
(both pass). 9 total in the two mobile test files, all passing.
#391 (OIDC sign-in) rewrites
onAppActive, and its version already returnsthe listener's promise, so the two conflict there. Resolving takes #391's
onAppActiveand this PR'sinitReminderSyncchange.🤖 Generated with Claude Code