fix(happy-app): debounce encryption-race message recovery (companion to #701)#4
Closed
cjb0001 wants to merge 1 commit intofix/sync-wedgefrom
Closed
fix(happy-app): debounce encryption-race message recovery (companion to #701)#4cjb0001 wants to merge 1 commit intofix/sync-wedgefrom
cjb0001 wants to merge 1 commit intofix/sync-wedgefrom
Conversation
Owner
Author
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.
Summary
Companion follow-up to slopus#701: add debounced recovery scheduling for session-encryption race paths so message sync does not repeatedly thrash retries when encryption is temporarily unavailable.
Why this follow-up
slopus#701 already addresses wedge behavior broadly (bounded retries, timeouts, cursor monotonicity, reverse pagination). One remaining edge case is transient session-encryption unavailability during fetch/update handling, which can still trigger repeated immediate invalidations.
This PR adds a tiny, focused recovery debounce to smooth that path.
Changes (on top of slopus#701)
messageRecoveryTimersmap.scheduleMessageRecovery(sessionId, delayMs=500)helper.fetchMessages, when session encryption is missing:new-messagepath, when encryption is still missing after session refresh:delete-sessioncleanup.File changed
packages/happy-app/sources/sync/sync.tsValidation
corepack yarn --cwd packages/happy-app typecheck✅Relationship to slopus#701
fix/sync-wedge(PR fix(sync): prevent App↔CLI sync permanent wedge slopus/happy#701 head)