Skip to content

fix(typebot-connector): make file-upload steps complete, and promote to stable - #53

Merged
rmyndharis merged 3 commits into
mainfrom
fix/typebot-file-input-answer-shape
Jul 31, 2026
Merged

fix(typebot-connector): make file-upload steps complete, and promote to stable#53
rmyndharis merged 3 commits into
mainfrom
fix/typebot-file-input-answer-shape

Conversation

@rmyndharis

Copy link
Copy Markdown
Owner

Fixes a defect that made typebot-connector's file-upload support unusable, then promotes the plugin to stable on the strength of a live verification.

The defect

When a Typebot flow reached a file-upload block, the plugin uploaded the contact's photo or document successfully — the bytes reached storage every time — and then the flow never moved on. Typebot answered Invalid message. Please, try again. and asked for the same file again, indefinitely. A contact could never complete a flow containing a file step.

The cause is that two different Typebot constructs were being answered the same way:

  • A file-upload block takes the uploaded file's URL as the answer itself, in the message text.
  • A text input that merely permits an attachment takes the typed answer, with the file carried alongside in a separate attachments field.

The plugin sent the second form for both, so a file-upload block never accepted what it was given. turn.ts now selects the form from the block being answered.

Why the tests did not catch it

upload-e2e.test.ts asserted the attachments form for a file-upload flow and passed, because its fake fetch accepts whatever it is handed — it pinned an assumption about Typebot rather than Typebot's actual behaviour. Both of its assertions are corrected here, and a third case is added covering a text input with attachments enabled, so the two constructs cannot be swapped again without a test failing. Inverting the branch turns all three red.

Live verification

Run on 2026-07-31 against OpenWA 0.12.1 and a self-hosted Typebot v3.17.2 with MinIO storage, using two connected WhatsApp sessions so a real inbound photo could be driven end to end.

  • A real WhatsApp photo — including an @lid sender and WhatsApp's own JPEG transcode — reached the plugin with usable media data, was uploaded, and the flow advanced from the file-upload block to the next block.
  • The stored object carried the Cache-Control header the plugin sets, confirming the upload was performed by the plugin rather than by anything else in the path.
  • Reverting the fix while leaving everything else identical reproduced the failure: the flow stayed on the file-upload block.

Scope of that run, stated precisely: Typebot v3.17.2 returns no form data from its upload-URL endpoint, so the same-origin signed-PUT branch was exercised. The S3 presigned-POST branch, which only older self-hosted installs use, was not reached, and Typebot Cloud was not covered.

Status

typebot-connector moves from beta to stable at 0.2.1. testedOpenWAVersion remains 0.12.1, which is the host the verification ran against. No other plugin changes.

…age.text

Typebot rejects {type:'text', text:'', attachedFileUrls:[url]} for a file
input block with "Invalid message. Please, try again." and re-asks forever
— verified against a live Typebot v3.17.2 instance. A file input block's
answer IS the file, so it wants the URL in message.text. attachedFileUrls
is only correct for a text input with attachments enabled, where the typed
text is the answer and the file rides along separately.

reply-map.ts collapses both constructs into the same 'file' ReplyIntent,
so turn.ts now branches on state.awaiting.kind at the point the continueChat
message is built, choosing the right shape for each construct.
Patch release for da9f94e: file-upload steps no longer get stuck
re-asking for the same file after a successful upload.
Smoke-tested end-to-end on 2026-07-31 against a self-hosted Typebot
v3.17.2 install over live WhatsApp through OpenWA 0.12.1: an uploaded
file-upload answer now advances the flow as fixed in 0.2.1.
@rmyndharis
rmyndharis merged commit bf2c1ba into main Jul 31, 2026
1 check passed
@rmyndharis
rmyndharis deleted the fix/typebot-file-input-answer-shape branch July 31, 2026 16:43
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