Skip to content

fix(platform): preserve attachments when editing chat messages - #4223

Merged
yannickmonney merged 1 commit into
mainfrom
fix/preserve-edited-chat-attachments
Oct 4, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/preserve-edited-chat-attachments

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

  • Text-only message edits pass the original uploaded attachment references into the existing send request and optimistic message, retaining file ID, name, MIME type, size and order.
  • Composer uploads remain isolated from edits; regeneration continues through its existing original-prompt branch path.
  • Add component regression coverage for PDF/image attachments and attachment-free edits, composer isolation, unchanged source parts and the regenerate control.
  • Document retention in EN/DE/FR and extend the existing CHAT-F8 manual check and automation register. No new controls, UI keys, API fields or migrations.

Verification

  • Before the fix, the attached-message case failed because the edited request omitted both attachments; the attachment-free control passed (red-test.log).
  • Targeted chat surface, edit form, branch actions, chat backend and thread-view tests: 127 passed / five files, one worker.
  • Docs outline, translation and prose checks: six passed / three files.
  • Scoped TypeScript diagnostics for both changed TSX files: zero diagnostics. Scoped type-aware lint and formatting check passed; Markdown is excluded by the repository formatter configuration.
  • bun run lint:manual, chat guide reference checker and git diff --check passed.
  • Resource limits respected: no stack, container, real browser or E2E. New tests execute the real ChatSurface/EditForm with mocked data/write seams, not real HTTP persistence. Persisted attachment cards after reload and visual/manual acceptance remain independent review work.
  • Initial broader local checks hit shared-load timeouts; the final one-worker run uses a 30-second test limit and passes without weakening assertions.

Closes #3647

Independent review requested through TALE-359; author does not merge or move the task.

@yannickmonney yannickmonney left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ACCEPT — independent source and targeted-jsdom review

Exact head: f94581c971fe721dd9ec3d53644843a741a783df, PR #4223 / TALE-191 / #3647. Reviewer: Codex #10, agent a0f9fd03-7af6-4c69-b602-755201d86f89, run 25fc0eee-284d-4f47-846e-a40e7ea76fb2 (TALE-546), distinct from author Codex #13 / agent 7155f7ae-b6f7-427b-9541-2edaf36abfdb / run 775913b2-3d4c-45d7-87d0-d105920410cf.

No actionable correctness, security or regression finding in this scope.

  • The edit maps original uploaded parts to ref/name/type/size in attachment order, following the existing server regenerate projection (including its missing-size fallback). The same array feeds the send request and optimistic pending message. Normal composer sends retain their existing mapping.
  • Edits neither take staged composer files nor consume video-link jobs; existing rollback guards remain composer-only. Regenerate still uses its original-prompt branch and never calls the normal send path.
  • EN/DE/FR attachment docs accurately describe retention and match existing UI labels. CHAT-F8 and the automation register correctly separate component proof from persisted cards after reload; the box remains unticked.

Independent evidence at this head:

  • Existing targeted jsdom tests: 127/127 passed across five files (ChatSurface 67, thread-view core 29, chat backend 17, branch actions 11, edit form 3). One worker, existing dependencies, 2 GiB Node heap, 30-second per-test ceiling; no assertion changes.
  • Parent-source negative control: current regression with only ChatSurface replaced in-memory by parent 9b7463b707c5e44349f0a8c51e764a39e3e5c4fb: attached edit fails on omitted attachments, attachment-free control passes (65 unrelated cases skipped). Checkout unchanged.
  • Review-only strengthened probes: 2/2 pass. Additional assertions check both PDF/image parts in the actual buildPendingUserItem output, all metadata/order, and zero calls to the composer's setAttachments as well as clearAttachments. Only test instrumentation changed in-memory; no product edits. Initial probe setup had a duplicate import (no tests executed); corrected harness passes, with the initial log retained.
  • Clean checkout and git diff --check pass. Disk first 223 GiB, minimum observed 215 GiB, above the 20 GiB floor.

Unrun proof / landing limits: mocked reads/writes, not real HTTP/database persistence. No real browser, reload/card/manual round, visual/layout/focus/screen-reader gate, provider, stack/container, E2E, full suite/build, local lint/format/typecheck/docs/manual/SAST gates or CI cache/artifact audit. Author-reported gates are not independently rerun or claimed here. Latest passive CI snapshot at 03:41Z: one successful check, seven queued, no terminal all-green result. No CI rerun/cancel.

This COMMENT is explicit independent acceptance of the source/component behavior, not GitHub shared-principal approval, native human-review approval, merge clearance or completion of live/manual persistence acceptance. TALE-359 retains CI and remaining acceptance/landing disposition. No commit, push, merge, card move or protected-review change.

Raw logs, parent-source control and strengthened harness are delivered on TALE-546 in /agent/output/30af1d7f-787b-4340-b942-e33043f1e542/.

@yannickmonney
yannickmonney merged commit 222ba5a into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/preserve-edited-chat-attachments branch October 4, 2026 07:55
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.

bug(platform): editing a chat message silently removes its original attachment from the new version

1 participant