Repository navigation
Deliver Telegram photos and voice notes in linked DMs - #2138
Merged
Merged
Conversation
A caption-less photo or voice note died silently: Telegram attachments only carry a fetchData download, so content and mediaUrl were empty and the 'no text' gate dropped the event before the bot saw anything. Direct messages now store those files as thread artifacts through the same storeAttachment path team chat uses, render them as image/file blocks, and still deliver a '[file: name (unavailable)]' note when the download fails. Routine wakes get a files list so a media-only event is not blank.
|
@princejain756 is attempting to deploy a commit to the Inbox Zero Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryLinked DMs now store provider-held attachments and send image or file blocks alongside captions.
|
Contributor
Playwright screenshotsNo new feature frames; gallery is suite-vs-main drift. Open screenshot gallery · Dashboard · CI run Updated for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Photos, voice notes and files sent to a Telegram-linked bot in DM were ignored: the adapter builds those attachments with
fetchData(a bot-credential download) and nourl, socontentandmediaUrlcame out empty and the "no text" gate dropped the event. With a caption, only the caption reached the bot. Closes #2038.What changed
handleDirectEventtreatsevent.attachmentsas content: a media-only message no longer hits the empty-text return in either the linked or the open-signup branch.storeInboundMediadownloads provider-held files into thread artifacts via astoreAttachmentdep (same signature the TeamChat bridge uses), capped atATTACHMENT_MAX_COUNT, noncesmessaging-attachment:<provider>:<handle>:<i>so webhook retries replay. The DM message now carries image/file blocks plus the caption, andpromptTextForAttachmentsbuilds the prompt.[file: name (unavailable)]line so the bot still learns something arrived.wakeMessageRoutinesadds afileslist to the untrusted delivery payload so a media-only event is not blank for message-trigger routines.app.tswiresstoreAttachmenttostoreInboundAttachment(same wiring the bridge already had).How tested
pnpm vitest run apps/api/src/messaging-inbound.test.tspasses (52 tests, incl. new cases: photo-only DM stored as an image artifact, caption+file delivered together, failed download falls back to a note, routine payload lists files, truly empty DM still ignored).pnpm --filter @rakazo/api checkclean. Not exercised against a live Telegram bot.