Skip to content

fix(platform): send the live inbox editor document - #3568

Merged
yannickmonney merged 15 commits into
mainfrom
fix/inbox-send-live-document
Sep 28, 2026
Merged

yannickmonney merged 15 commits into
mainfrom
fix/inbox-send-live-document

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Sending an Inbox reply or new email before Milkdown published its draft could omit visible text, or pair current HTML with outdated undo Markdown. Read HTML and Markdown in one synchronous editor action, and derive emptiness and source Markdown from that current document.

The new Chromium regression holds delivery at Milkdown's publication boundary while retaining the real editor, serializers and send adapters. It covers initial text with an attachment, editing and clearing a saved draft, attachment-only sends, and an empty editor without files.

Validation:

  • New regression on base: 6 failures / 4 passing controls. With fix, new and existing editor browser suites: 14/14 pass.
  • Editor and outbound HTML unit suites: 15/15 pass; focused type-aware lint, formatting, manual references, Opengrep and React Doctor pass.
  • Original standalone commit 4c412adb95453d708665a13551a5211730fef228 only: full bun run check under pinned Bun 1.4.2 with TURBO_CONCURRENCY=1: 55/55 tasks pass (42 cached), including platform UI 465 files / 3,817 tests. Full Opengrep exits 0 with 0 findings across 467 rules / 3,985 files. Coverage limits: 34 partially analyzed files (parse/internal engine errors), 1,998 excluded files, 17 files over 1 MB skipped, and 3 rule timeouts on services/platform/messages/en.yml.
  • A separate natural-timing probe passes all 4 payload assertions after this fix but still reports two existing uncaught Milkdown teardown errors, tracked in Bug: Inbox editor emits an uncaught Milkdown error after rapid send #3567. The deterministic regression waits for the internal publication attempt while holding its application callback; it proves current-document serialization without racing wall-clock timing or suppressing exceptions.

Integration: this branch now includes #3566 (which depends on #3552), with the live-editor mock and canonical Markdown fixture adaptations. The pinned compatibility review records 30 Chromium + 30 UI passing checks on the scratch combination. Integrated head 5e18078bdbc62a6cabb65fa9b4c82b792635bf91 has identical production files and two stronger test assertions. Fresh direct runs in a separate clean checkout passed 30 Chromium and 30 UI tests under pinned Bun 1.4.2. The standalone full-check/SAST results above do not cover this integrated tree. Its full gate and current-head CI remain pending.

Fixes #3565

Independent merge review refreshed this branch against main after the upload-failure fix landed, preserving both mobile Inbox clearance classes. The only test conflict was the send assertion: live serialization normalizes a plain paragraph with a trailing newline, including an Undo seed that had none. The browser configuration explicitly prebundles the listener to prevent a late dependency discovery from reloading an existing test page. Fresh validation at 38e500b5de27f7fe95200e48dfe35886405ec74c passed 30 Chromium cases, 13 editor component cases and the manual inventory guard. The editor and surrounding Inbox production code are byte-identical to the prior reviewed integration; this refresh includes the latest main changes. A separate integration with the proposed Milkdown7.21.3 update passed36 Chromium and215 conversation component cases.

Undoing a queued reply handed back its markdown only, and the panel seeded
the composer only when there was some, so undoing an attachment-only reply
restored nothing. The undo door now hands back the files the recalled send
named (email and API lanes), the panel seeds the reply box with both, and a
re-send names the same stored blobs instead of uploading them again. The
restored draft seeds only the conversation it was undone in.

The remove button on a file chip in the reply box had no accessible name
(WCAG 4.1.2). It is named after the whole file name through the existing
common.aria.removeNamed key (en, de, fr), with a visible focus ring.

Manual boxes CONV-F33 and CONV-A8 with their automation row.

@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.

Reviewed 4c412ad.

The send path now derives HTML, emptiness and sourceMarkdown from the live Milkdown document in one synchronous action. This removes the stale persisted-draft gate without adding a delay or another renderer, and retains toOutboundHtml and attachment-only behavior.

I independently ran the new snapshot and existing editor Chromium suites directly under the pinned Bun 1.4.2: 14/14 passed, with no unhandled test errors. The new cases exercise the actual reply/compose adapters and outgoing mocked HTTP payloads while explicitly proving that persisted Markdown is stale. I also reviewed the initial, edited, cleared and empty document assertions and the source change. No blocking finding in this focused diff.

Coverage is deliberately separate: the deterministic test holds application publication after the internal debounce attempt; it does not prove pending-timer teardown. The natural timing probe’s remaining uncaught context errors are correctly tracked in #3567. Full repository and full security gates remain pending for this exact head. No external mail or production testing was performed.

@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.

Compatibility check with #3566 at c8ed429, using this PR's exact 4c412ad.

The cherry-pick applies cleanly and the production paths compose: live body serialization retains the stored/new attachment, rejection and cleanup behavior. However, the unadjusted combined suites are not green: three upload/undo browser assertions expect the raw persisted seed without Milkdown's terminal newline, and two undo unit fixtures do not seed the new live editor mock.

Carry these small fixture adaptations when integrating the two PRs:

  • In inbox-upload-failure.browser.test.tsx, checkSendFailure's successful retry expects exact sourceMarkdown: body + '\n' for its one-paragraph fixture, rather than JSON.parse(bodyBefore). Keep the exact failed-send storage equality unchanged.
  • In message-editor.test.tsx, seed liveMarkdown/liveHtml to The invoice is attached. / <p>The invoice is attached.</p> in the text+files undo case; seed them to '' / <p></p> in the files-only undo case.

With only those fixture adjustments, fresh direct pinned-Bun runs pass 30/30 Chromium and 30/30 UI tests. No production code was changed beyond the exact candidate commit; combined tested tree e8edbe3f265aba1965a09e99c4cc4029f66c3d42. The retained patch is /Users/yannick/.codex/notes/tale-fleet-3566-3568-fixture-adaptation.patch. No full gate or #3567 teardown fix is claimed by this focused compatibility check.

@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.

Final focused integration verification at 5e18078: fresh direct 30/30 Chromium and 30/30 UI tests pass in a separate clean checkout under pinned Bun 1.4.2. The production files are byte-identical to the previously tested combined tree e8edbe3f265aba1965a09e99c4cc4029f66c3d42; its only differences are stronger exact-HTML test assertions. The fixture adaptations requested in the earlier compatibility review are now present.

The standalone 55/55 full check and full SAST results remain pinned to 4c412ad. I updated the PR description to separate those from this focused integrated-head proof. Full integrated-tree validation and current-head CI remain pending. No production/provider testing or merge.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Read-only review refresh pinned to 5e18078bdbc62a6cabb65fa9b4c82b792635bf91.

The head is unchanged from the exact-head local verification: 30 Chromium tests + 30 UI tests passed freshly with Bun 1.4.2 and maxWorkers=2, covering live editor snapshots, upload/send refusal and retry, stored/new attachments, and undo restoration. The detached checkout remains clean. No new source finding from this bounded refresh.

CI currently reports 43 successful, 6 skipped, and 1 neutral check. Inspected job logs distinguish actual execution from replay: platform Browser ran 143 tests on a cache miss (the shared UI browser task replayed its 119-test cache); platform UI ran 3,830 tests on a cache miss.

Merge remains blocked: GitHub reports DIRTY. Read-only git merge-tree against current main 9662e8a5c34bcfa6f6a6512e6eb971bc618763c0 reproduces conflicts in:

  • services/platform/app/features/conversations/components/conversation-panel.tsx
  • services/platform/app/features/conversations/components/message-editor.test.tsx
  • services/platform/tests/manual/reference/automation.md

The green evidence above is for the existing head, not a future resolved tree. The PR owner/native task coordination owns resolution; preserve mobile clearance, live snapshot semantics, and stored/new attachment recovery, then verify the resolved head. No source or conflict-resolution edits were made in this review.

# Conflicts:
#	services/platform/app/features/conversations/components/inbox-upload-failure.browser.test.tsx
@yannickmonney
yannickmonney merged commit 2c90922 into main Sep 28, 2026
50 checks passed
@yannickmonney
yannickmonney deleted the fix/inbox-send-live-document branch September 28, 2026 08:34
yannickmonney added a commit that referenced this pull request Sep 28, 2026
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: immediate Inbox Send can drop visible message text

1 participant