Skip to content

fix(web): scope optimistic messages and preserve preview handoffs (chase 261028 B39) - #1950

Closed
lidge-jun wants to merge 2 commits into
devfrom
chase/261028-b39-optimistic-messages
Closed

lidge-jun wants to merge 2 commits into
devfrom
chase/261028-b39-optimistic-messages

Conversation

@lidge-jun

Copy link
Copy Markdown
Contributor

Acknowledged optimistic messages remained in local state until a timer ran, while delayed send updates could reach a different thread. A send failure after acknowledgement could also revoke the blob preview still displayed by the server's message.

Upstream commit Upstream PR Decision What GOAT got
71ba6b374c0b0181130c0cc3b3d5aaa3387ada67 #25710 Adapt Immediate acknowledgement retirement, scoped late-update rejection, and explicit blob/handoff ownership.

GOAT adjustments

  • Scope optimistic state, preview ownership, and dispatch reset with GOAT's environment/thread key, preserving draft promotion and isolating identical thread IDs on different servers.
  • Retain GOAT's queued-message acknowledgement sources, existing image preload path, and composer behavior. Apply the scoped setter to all existing optimistic send entry points; remove the two obsolete preview-revocation helpers after checking consumers.
  • Add eight regression cases beside the new state module for permanent retirement, navigation, late updates across environments, and preview ownership before/after acknowledgement. They were not executed locally under the task's explicit verification override.
  • Web and desktop share this chat lifecycle. No mobile, provider, contract, layout, styling, or documentation behavior changes are required.

Rename residue

git show 71ba6b374c | rg '^\+.*\b[Tt]3' lists three added imports of @t3tools/contracts:

Upstream file Disposition
chat/optimisticUserMessages.test.ts Adapted as @goat/contracts; package-scope rule in scripts/lib/goat-rename/rules.ts.
chat/optimisticUserMessages.ts Adapted as @goat/contracts; same rule.
chat/useAttachmentPreviewHandoff.ts Adapted as @goat/contracts; same rule.

No T3 identifiers were kept and no upstream commit was left out.

Verification

  • vp fmt apps/web/src/components/ChatView.logic.ts apps/web/src/components/ChatView.tsx apps/web/src/components/chat/optimisticUserMessages.ts apps/web/src/components/chat/optimisticUserMessages.test.ts apps/web/src/components/chat/useAttachmentPreviewHandoff.ts apps/web/src/components/chat/useComposerSend.ts — exit 0, six files.
  • node scripts/goat-rename.ts --check — exit 0: 0 lines with T3 residue in 0 files, 0 dropped paths.
  • git diff --check and git diff --cached --check — exit 0.

NOT RUN: vp test run apps/web/src/components/ChatView.logic.test.ts apps/web/src/components/chat/optimisticUserMessages.test.ts (including red/green regression proof), vp run check:changed, vp run typecheck, vitest, builds, server suites, and lockf-wrapped runs, per the task's explicit no-local-suites override. Browser captures, real-client verification, and native mobile verification are unavailable on this machine. goat-ci is the verification gate; this lane does not wait for CI, request reviews, watch, or merge.

Model: gpt-6.1-sol via GOAT delegated task (Codex harness)

Retire acknowledged messages during reconciliation and reject delayed updates
for a different environment or thread. Keep blob previews owned by their
handoff when a send reports failure after the server has acknowledged it.

Upstream: 71ba6b374c0b0181130c0cc3b3d5aaa3387ada67 (#25710)
@lidge-jun

Copy link
Copy Markdown
Contributor Author

Landed as part of the combined chase PR #1982 (squash 5a9569e), at the user's request to merge the rest of cycle 261028 as one PR. Closing.

@lidge-jun lidge-jun closed this Oct 27, 2026
@lidge-jun
lidge-jun deleted the chase/261028-b39-optimistic-messages branch October 30, 2026 05:56
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