Skip to content

refactor(mothership): a saved Stop handoff's id wins on restore - #8747

Merged
waleedlatif1 merged 1 commit into
stagingfrom
refactor/mothership-reused-id-tiebreak
Oct 7, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
refactor/mothership-reused-id-tiebreak

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #8746, from its review. No behaviour change for anything staging can produce.

  • Restoring an old saved queue, the seed's id wins. refactor(mothership): keep a queued send's reused id in one field #8746 moves the id a saved Stop handoff carried to resumeUserMessageId. Where an entry also had its own resumeUserMessageId and the two differed, it kept the entry's. It now keeps the seed's. That is the id the build that saved the entry sent: queuedSendHandoff?.userMessageId ?? resumeUserMessageId. Staging never produces two different ids, but the mapping now matches it exactly.
  • resumeUserMessageId's doc comment names every path that sets it. Besides a send an unmount withdrew, these are:
    • a Send-now restored from its stored Stop handoff;
    • a dispatch put back in the queue.

Type of Change

  • Improvement (refactor)

Testing

  • moves the reused id a saved Stop handoff carried onto the entry, over its own (store.dom.test.ts) gains an entry carrying both ids. It fails on staging.
  • The targeted suite passes 1072/1072. The quick gate (lint, typecheck, audits and unit tests) ran on the CI runner.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

When an entry saved with an id on its Stop handoff also has its own
resumeUserMessageId, the handoff's id is the one that build sent, so it
is the one kept. resumeUserMessageId's doc names every path that sets it.
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 7, 2026 3:33pm UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how a queued message picks its send ID on restore.

This PR appears safe to merge.

What we checked:

  • Restore retries the wrong message: The older send path preferred the handoff’s ID. Restore now keeps that same ID, and the current send path reads it from resumeUserMessageId.

Summary

Restoring an older saved queue now prefers the Stop handoff’s message ID when the entry carries two different IDs. This matches the older send path.

  • Adds a regression case with conflicting IDs.
  • Expands the resumeUserMessageId comment to cover its recovery paths.
  • No actionable issues found. Tests were inspected, not run.

Reviews (1) · Last reviewed commit: "refactor(mothership): a saved Stop hando..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 8760ca7 into staging Oct 7, 2026
35 checks passed
@waleedlatif1
waleedlatif1 deleted the refactor/mothership-reused-id-tiebreak branch October 7, 2026 16:32

This branch was previously deployed

1 inactive deployment
Preview — 8fce0210 Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant