Skip to content

fix(bot): messaging follow-ups — Host appUrl, resume delivery, keep Linked notice (#1066 #1067 #1068) - #1069

Merged
Daanish2003 merged 8 commits into
mainfrom
chore/messaging-follow-ups
Oct 30, 2026
Merged

Daanish2003 merged 8 commits into
mainfrom
chore/messaging-follow-ups

Conversation

@Daanish2003

Copy link
Copy Markdown
Owner

Summary

Three follow-ups from spec #1044 (Messaging Channels 1, Telegram):

  • Messaging Channel links on a Host with no email or push #1066: a Host with only a messaging adapter now gets the same <appUrl>/bots/<botId> links. New Host option createBotSdk({ appUrl }), resolved once in appUrlOf (packages/botsdk/bot/src/bot/channels.ts): the Host's appUrl, else the email or push adapter's, with trailing slashes stripped.
  • Resume a messaging delivery after a part fails #1067: a delivery that fails partway resumes after the last part sent, so the user gets each part once and a later button edit still finds the buttons message. The seam gains MessagingSendError (with SendProgress) and OutboundMessage.resume. The core keeps the progress as a sentOn key in message.parts jsonb, with no new column. Telegram and the fake adapter both skip parts already sent.
  • Keep the "Linked to your account" notice when the token is rejected #1068: the Linked notice is kept. A token rejected while sending it marks the account needs_attention and stops its listener, through a shared rejected() in channel-listeners.ts.

How it was tested

Decisions I made

  • The Host option is createBotSdk({ appUrl }). The owner chose it after the first cut used channelAppUrl, because Hosts never build channel() themselves. It affects messaging links only; email and push still use their adapter's own appUrl.
  • Resume a messaging delivery after a part fails #1067 resume state lives in message.parts jsonb (sentOn: platform, chat, body digest and progress), not in a new column. A retry resumes only when platform, chat and body digest all match; otherwise it resends the whole Message. The fake adapter now splits a Message into parts, so a Message with text and files reports one id per part.
  • Keep the "Linked to your account" notice when the token is rejected #1068 uses option (a): stop the listener on a rejected token, without rethrowing.

Risk

  • Resume a messaging delivery after a part fails #1067 changes the adapter seam that every messaging adapter implements: new optional resume and a new error type. Only Telegram exists today.
  • sentOn isn't cleared after a full success. A rerun after a full success already resent everything before this change.

Closes #1066
Closes #1067
Closes #1068

🤖 Generated with Claude Code

Daanish2003 and others added 8 commits October 30, 2026 19:36
A messaging adapter's send now throws MessagingSendError with what it
sent (parts and message ids) when a later part fails. The core keeps
that progress on the Message's parts (sentOn), and the channel.deliver
retry passes it back as the Message's resume, so the adapter sends only
the remaining parts and reports every id, buttons included. Telegram and
the fake messaging adapter (which now splits text and files into parts)
both resume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t's listener (#1068)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1066)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y piece (#1067)

Code-review fixes. The kept progress carries a digest of what was sent,
so a retry whose Message changed since (a file now linked instead)
resends it whole rather than skipping the wrong parts. Telegram resumes
a part it was resending as plain text after the pieces already sent
(SendProgress.pieces), and throws the platform's own error when nothing
was sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Daanish2003
Daanish2003 merged commit 4db6c3c into main Oct 30, 2026
1 of 2 checks passed
@Daanish2003
Daanish2003 deleted the chore/messaging-follow-ups branch October 30, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant