Starting a workflow fails with "Could not encode input" when a browser codec endpoint is saved but the override is off

Aperta Adatta ai principianti
#4,213 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@pcbeingused33 ci sta già lavorando.

Dal 26/11/2026.

  • #4226 di @pcbeingused33 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Leggi prima src/lib/utilities/get-codec.ts per vedere la regola post-#3490: il $codecEndpoint del browser si applica solo quando $overrideRemoteCodecConfiguration è true. Poi confronta src/lib/stores/data-encoder.ts intorno alla riga 55, dove settingsEndpoint || $codecEndpoint applica ancora il vecchio fallback. Allinea l'endpoint dello store a getCodecEndpoint, oppure vincola encodePayloads in src/lib/utilities/encode-payload.ts a getCodecEndpoint(page.data.settings). Fatto significa che avviare un workflow con un endpoint localStorage obsoleto, override disattivato e nessun namespace codec invia l'input non codificato, con i test data-encoder esistenti che passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Starting a workflow from the UI fails with Could not encode input for starting workflow when the browser has a codec endpoint saved in localStorage, "Use Namespace-level setting, where available" is selected (override off), and the namespace has no codec endpoint configured. The input is valid JSON and no codec server is in use.

Two places resolve the codec endpoint with different rules:

encodePayloads decides whether to call the codec from the store (utilities/encode-payload.ts#L102-L103), so it calls encodePayloadsWithCodec. codeServerRequest then resolves the endpoint through getCodecEndpoint, gets '', and throws NO_CODEC_SERVER_CONFIGURED_ERROR for encode (services/data-encoder.ts#L55-L56). startWorkflow reports that as Could not encode input for starting workflow (services/workflow-service.ts#L717).

Decoding is unaffected because the decode path returns payloads unchanged when no endpoint resolves, which is why this only shows up when starting a workflow (and likely other encode paths such as signals or updates with input).

#3490 fixed getCodecEndpoint, getCodecPassAccessToken and getCodecIncludeCredentials but left the dataEncoder store on the old fallback.

To Reproduce

  1. In the Data Encoder settings, save any browser codec endpoint (for example http://localhost:8081), then select "Use Namespace-level setting, where available". Equivalently, have a stale endpoint key in localStorage with overrideRemoteCodecConfiguration false.
  2. Open a namespace with no codec endpoint configured.
  3. Go to Start Workflow, fill in a workflow ID, task queue and type, set the input to "Hi" with encoding json/plain.
  4. Click Start Workflow.
  5. See Could not encode input for starting workflow.

Running localStorage.removeItem('endpoint') and reloading makes the same start succeed.

Expected behavior

With the override off and no namespace codec endpoint, the workflow starts with the input unencoded, matching how decoding already behaves after #3490.

A likely fix is to make the store's endpoint follow the same rule as getCodecEndpoint (only use $codecEndpoint when $overrideRemoteCodecConfiguration is true), or to have encodePayloads gate on getCodecEndpoint(page.data.settings).

Screenshots

The Start Workflow form shows a valid "Hi" input with json/plain selected, and the error banner Could not encode input for starting workflow.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: observed in the Temporal Cloud UI
  • Version: code references above are from main at 051de46

Additional context

Regression from #3490 (DT-4044).

Lingua principale
TypeScript
Stelle
452
Fork
208
Merge medio
1g 18h
PR unite (30g)
60

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/ui

Tutte le issue di temporalio/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.