firestore-translate-text: a null input on update errors and leaves stale translations instead of clearing them, in both extension and kit
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- firebase, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu với handleUpdateDocument trong firestore-translate-text/functions/src/index.ts:236 và handler tương ứng trong kits/firestore-translate-text/src/handlers.ts:147; kiểm tra translate/translateDocument.ts:66 để xác nhận đường dẫn null. Thêm bài kiểm tra handler được mô tả trong issue, kiểm tra việc xóa và việc không có lệnh gọi dịch nào; sau đó thêm các mục CHANGELOG cho cả hai codebase. Được xem là hoàn tất khi các bản cập nhật null xóa translated mà không có lỗi và extension với kit duy trì hành vi giống hệt nhau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 979
- Fork
- 434
- Merge trung bình
- 20 giờ 44 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/extensions
-
decision(storage-resize-images): kit/extension parity – ALLOWED_EVENT_TYPES is ignored, the kit reads EXT_SELECTED_EVENTSCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdecision kits
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
firebase/extensions#3273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(storage-resize-images): kit README's Multiple instances section fails in an installed projectĐang mởkits type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
firebase/extensions#3271 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kits type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
firebase/extensions#3270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(storage-resize-images): kit/extension parity – BUCKET_REGION offers europe-north2 and northamerica-south1, which can't deployCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởkits type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firebase/extensions#3268 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(storage-resize-images): kit/extension parity – onCompletion event no longer carries the object nameCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởkits type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
firebase/extensions#3266 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/extensions
Issue tương tự
-
skillopt: success-reflect prompt omits the edit schema, so every success-only edit is droppedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Workspace secrets/constants containing "$" are corrupted when resolved in data source optionsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
mobile-next/mobile-mcp#526 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày