Repository navigation
refactor(mothership): one hold field and one retry field on a queued send - #8743
Merged
Merged
Conversation
…send
A queued message's wait is now hold ('user' or 'online') instead of
retryRequired plus heldUntilOnline, and its automatic retry is
retry: { attempt, notBefore } instead of sendRetries plus notBefore, which
folds ScheduledRetry away. Queues saved in the older shape are mapped when
the session restores them.
- one lookup instead of a hop loop: only a new-chat key moves, and only to its chat's key, which never does; liveQueueKey derives from liveQueuePosition - migrate keeps the first record, so a repeat cannot rewrite what was ahead - the history check drops its no-op forwarding: it never runs on a new-chat key - the dead-key DOM test waits on the queue instead of a fixed sleep
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Contributor
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Merged
7 tasks done
This branch was previously 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.
Summary
Third step of the chat send-queue consolidation (after #8740 and #8741): one wait field and one retry field on a queued send. No behaviour change.
hold?: 'user' | 'online'replacesretryRequired+heldUntilOnline.usermeans a failed dispatch waits for the user to send or edit it.onlinemeans it waits for the browser to come back online, or the user.retry?: { attempt, notBefore }(SendRetry) replacessendRetries+notBefore, andScheduledRetrygoes away.deferRetrytakes the new shape.requeuedFieldsreturns{ hold }or{ retry }, plus the chatless surface;hold: 'online';hold,retryandheldSurface;retry.notBefore.retryRequiredbecomeshold: 'user'('online'withheldUntilOnline), andsendRetries+notBeforebecomeretry. Staging builds have persisted the old shape to session storage.liveQueuePositiondoes one lookup instead of a hop loop, since only a new-chat key moves and only once, andliveQueueKeyderives from it;migratekeeps the first record, so a repeat can't rewrite what was ahead;Type of Change
Testing
restores the hold and retry fields of a queue saved in their older shape(store.dom.test.ts) covers user, online, retrying and plain entries.keeps the first move when the same new-chat queue is migrated again(store.test.ts) covers themigratefirst-record guard; it fails without it.Checklist