fix: encode the webhook GET payload as UTF-8 so non-ASCII arguments work
What does this PR do?
On a script or flow's Webhooks panel, choosing a GET call (or Sync SSE with the token in the query) puts the arguments in the URL as payload=<base64 JSON>. With any non-ASCII argument that URL does not work:
- An accented name such as
Joségives a URL the server refuses: "Internal: Impossible to decode query payload: ... invalid unicode code point". - Japanese text or an emoji throws
Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 rangein the console, and the panel keeps showing the URL for the previous value.
WebhooksConfigSection.svelte passed the JSON string straight to btoa, which only accepts Latin-1 characters and encodes each one as a single byte, while the server decodes the payload as UTF-8. This PR encodes the JSON as UTF-8 bytes before btoa: three changed lines plus a comment. ASCII arguments give exactly the same URL as before.
Reproduced on main at 96c97b0 (CE v1.875.0).
flowchart TD
A[Argument with an accent or emoji] --> B{GET webhook URL}
B -->|Before| C[Server cannot decode the payload]
B -->|After| D[Script runs with the value as typed]
Narrated recording, before then after (sound on):
https://github.com/user-attachments/assets/88778f36-6a8d-4fda-8642-fdb010afbebf
The recording is the real app (frontend dev server from this checkout against the main backend image). The URL shown in the panel is opened in a new tab of the same signed-in browser. Waits on page loads are shortened; nothing else is edited.
Edge cases and unchanged behaviour checked
All checked in the running app, on this branch:
- Japanese text and an emoji (
東京 🚀) run and come back as typed. a+b/c=d & e?(base64 and URL-special characters) comes back as typed.- Unchanged: a plain ASCII name (
Ada) gives the samepayloadasmain(same bytes, same base64), and runs. - Unchanged: the POST request body shown in the panel.
Checks run
npm run lint(oxlint): passes.prettier --checkon the changed file: passes.- No unit test: the encoding is inline in the component, and there is no test file for it.
- Not run:
npm run check(svelte-check needs about 8 GB here) andnpm run check:fast(no bun on this machine).
Related issue
None filed. Found on the Webhooks panel of a script.
AI assistance (Claude Code) was used to find, fix and record this. I reproduced and verified it in the running app.
🤖 Generated with Claude Code
Summary by cubic
Fixes GET webhook URLs with non-ASCII arguments, which previously failed to decode on the server (e.g. José) or threw a btoa error in the console (Japanese text, emoji).
The payload JSON is now encoded as UTF-8 bytes before btoa, matching the server's UTF-8 decoding. ASCII arguments produce exactly the same URL as before.