firestore-translate-text: a null input on update errors and leaves stale translations instead of clearing them, in both extension and kit
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- firebase, typescript
- Ambito
- backend
Direzione di ricerca
Inizia con handleUpdateDocument in firestore-translate-text/functions/src/index.ts:236 e con l’handler corrispondente in kits/firestore-translate-text/src/handlers.ts:147; ispeziona translate/translateDocument.ts:66 per confermare il percorso null. Aggiungi il test dell’handler descritto nell’issue, verificando l’eliminazione e che non venga effettuata alcuna chiamata di traduzione; poi aggiungi le voci CHANGELOG per entrambe le codebase. Il lavoro è completato quando gli aggiornamenti null cancellano translated senza errori e extension e kit mantengono un comportamento identico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Setting the input field to null on an existing document is the one "no text here" value that neither clears the translations nor gets skipped. It errors out and leaves the previous translations in place, in both the extension and the kit.
handleUpdateDocument clears the output field when the new input cannot be translated:
if (typeof inputAfter !== "string" && typeof inputAfter !== "object") {
await updateTranslations(after, FieldValue.delete());
return;
}
typeof null is "object", so null passes this check and falls through to translateDocument. Removing the field (undefined) or setting a number both hit the branch and clear translated; null does not.
Extension (firestore-translate-text/functions/src/index.ts:236, translate/translateDocument.ts:66): null routes into translateMultiple, Object.entries(null) throws TypeError, the handler catch logs it and records an error event. Nothing is written, so the stale translated map stays on the document.
Kit (kits/firestore-translate-text/src/handlers.ts:147): same check, same fall-through. Routing parity with the extension is restored under #3142, so the failure is identical.
Only reachable on update; create is guarded by if (input).
Proposed fix, one change across both codebases so they keep producing the same output for the same document: treat null as removed input in the delete branch.
if (
inputAfter === null ||
(typeof inputAfter !== "string" && typeof inputAfter !== "object")
) {
Plus one handler test: before input: "hello", after input: null, expect updateTranslations called with FieldValue.delete() and no translation call. Behaviour change for the extension too (error becomes clear), so it needs a CHANGELOG entry on both sides.
Split out of #3142, where the ruling was parity for the routing. Parity ledger: #2974, firestore-translate-text §4a.
- Lingua principale
- TypeScript
- Stelle
- 978
- Fork
- 433
- Merge medio
- 21h 58m
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 firebase/extensions
-
decision(storage-resize-images): kit/extension parity – ALLOWED_EVENT_TYPES is ignored, the kit reads EXT_SELECTED_EVENTSForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadecision kits
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
firebase/extensions#3273 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(storage-resize-images): kit README's Multiple instances section fails in an installed projectApertakits type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
firebase/extensions#3271 ·
I maintainer di solito rispondono entro 1 giorno
-
kits type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
firebase/extensions#3270 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(storage-resize-images): kit/extension parity – BUCKET_REGION offers europe-north2 and northamerica-south1, which can't deployForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertakits type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
firebase/extensions#3268 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(storage-resize-images): kit/extension parity – onCompletion event no longer carries the object nameForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertakits type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
firebase/extensions#3266 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di firebase/extensions
Issue simili
-
area:agent-view area:tui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
anthropics/claude-code#104558 ·
I maintainer di solito rispondono entro 1 giorno
-
updater
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
inmanta/web-console#7606 ·
I maintainer di solito rispondono entro 1 giorno
-
bug skills
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
equinor/fusion-framework#5846 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100