Starting a workflow fails with "Could not encode input" when a browser codec endpoint is saved but the override is off
I maintainer di solito rispondono entro 1 giorno
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:
- The
dataEncoderstore still falls back to the browser endpoint when the override is off (stores/data-encoder.ts#L55):settingsEndpoint || $codecEndpoint. getCodecEndpointonly uses the browser endpoint when the override is on, since #3490 (utilities/get-codec.ts#L16-L17).
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
- 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 staleendpointkey in localStorage withoverrideRemoteCodecConfigurationfalse. - Open a namespace with no codec endpoint configured.
- Go to Start Workflow, fill in a workflow ID, task queue and type, set the input to
"Hi"with encodingjson/plain. - Click Start Workflow.
- 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
mainat 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di temporalio/ui
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
temporalio/ui#4189 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
temporalio/ui#3840 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
temporalio/ui#3752 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
temporalio/ui#3744 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
temporalio/ui#3651 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di temporalio/ui
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
agilepathway/label-checker#1015 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
react-component/image#541 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno