Skip to content

feat(platform): undo, retry and discard outbound conversation messages - #2839

Merged
Israeltheminer merged 3 commits into
mainfrom
feat/conversation-outbound-undo-retry-discard
Jul 22, 2026
Merged

Israeltheminer merged 3 commits into
mainfrom
feat/conversation-outbound-undo-retry-discard

Conversation

@Israeltheminer

Copy link
Copy Markdown
Contributor

What

An email-client-style outbound lifecycle for conversation replies and compose:

  • Undo send — outbound sends are scheduled 10 s in the future instead of immediately; the bubble shows a live "Sending in Ns · Undo" countdown. Undo cancels the scheduled job, deletes the row, walks lastMessageAt back, and returns the source markdown so the composer re-seeds the draft.
  • Failed-send recovery — a failed send shows "Not delivered" with the provider error, plus Retry (reschedules, bumps retryCount) and Delete.
  • Outbound-HTML fidelity — the composer serializes via Milkdown getHTML() (@milkdown/kit) + a new toOutboundHtml() sanitizer, replacing the old ReactMarkdown/renderToStaticMarkup path (fixes literal <br /> in sent mail) and capturing the source markdown that Undo restores.

⚠️ Behavior change

Every outbound path through sendMessageViaIntegration (reply, compose, bulk) now carries a 10 s delivery delay — a deliberate, product-visible latency traded for the undo window. Flagging for product sign-off. (Known v1 edge, noted in undo_send_message.ts: an approval completed by the send stays completed after an undo.)

Scope

  • convex: new undo_send_message / retry_send_message / discard_outbound_message / recompute_conversation_last_message_at + edits to mutations, send_message_via_integration, transform_conversation, validators, compose_email_conversation, reply_to_conversation; regenerated _generated/api.d.ts.
  • app: message (countdown/undo/retry/delete), message-editor + new outbound-html, types, compose-email-pane, conversation-panel, hooks.
  • dep: @milkdown/kit. i18n: conversations.message.* + conversations.panel.*Failed (en/de/fr).

Test

  • convex: undo/retry/discard .test.ts (13 tests, incl. cross-org RLS, reject-after-fired, non-failed guards). UI: message.test, message-editor.test, outbound-html.test (16 tests). All green. typecheck · oxlint (type-aware) · oxfmt clean.

Israeltheminer and others added 3 commits July 22, 2026 01:46
Adds an email-client-style outbound lifecycle to conversation replies and
compose:

- Undo send: outbound sends are scheduled 10s in the future instead of
  immediately; the bubble shows a live "Sending in Ns · Undo" countdown.
  Undo cancels the scheduled job, deletes the row, walks lastMessageAt
  back, and returns the source markdown so the composer re-seeds the draft.
- Failed-send recovery: a failed send shows "Not delivered" with the
  provider error, plus Retry (reschedules, bumps retryCount) and Delete.
- Outbound-HTML fidelity: the composer serializes via Milkdown getHTML()
  (@milkdown/kit) + a new toOutboundHtml() sanitizer, replacing the old
  ReactMarkdown/renderToStaticMarkup path (fixes literal <br /> in sent
  mail) and capturing the source markdown that Undo restores.

Note: every outbound path through sendMessageViaIntegration (reply,
compose, bulk) now carries a 10s delivery delay — a deliberate,
product-visible latency traded for the undo window.
@Israeltheminer
Israeltheminer merged commit d8b53f7 into main Jul 22, 2026
29 of 32 checks passed
@Israeltheminer
Israeltheminer deleted the feat/conversation-outbound-undo-retry-discard branch July 22, 2026 11:51
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