chore: update workflow queues api#4230
chore: update workflow queues api#4230NathanFlurry wants to merge 1 commit into02-18-chore_simplify_queue_apifrom
Conversation
|
🚅 Deployed to the rivet-pr-4230 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: chore: update workflow queues apiThis PR replaces 7 separate Potential Bugs / Correctness IssuesHistory format migration — The rename from
// Before (checks length)
const hasMessages = result.waitingForMessages && result.waitingForMessages.length > 0;
// After (checks existence only)
const hasMessages = result.waitingForMessages \!== undefined;An empty Early return in completable fixture ( const [message] = await loopCtx.queue.next("queue-wait", { names: [WORKFLOW_QUEUE_NAME], completable: true });
if (\!message || \!message.complete) {
return Loop.continue(undefined); // silently skips storing
}When API Design NotesRemoval of
Minor / StyleInconsistent indentation in Indentation in
if (\!this.messageDriver.receiveMessages) {
this.storage.messages.push(message); // only for non-actor-backed drivers
}
await this.messageDriver.addMessage(message);The logic is correct — actor-backed drivers bypass local storage — but a brief comment explaining why the push is conditional ("actor-backed drivers manage their own message storage") would clarify intent. Test CoverageThe new tests for completable replay ( One gap: there is no test for the wildcard case ( Overall this is a solid API cleanup. The main item to resolve before merging is the history format migration concern for in-flight workflows. |

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: