Skip to content

fix: handle undefined values in updateKey() to prevent Firestore errors#987

Merged
stevenle merged 1 commit intomainfrom
fix/translation-metadata-undefined-value
Mar 23, 2026
Merged

fix: handle undefined values in updateKey() to prevent Firestore errors#987
stevenle merged 1 commit intomainfrom
fix/translation-metadata-undefined-value

Conversation

@jeremydw
Copy link
Member

Fixes Firestore invalid-argument error when saving translation metadata by converting undefined values to deleteField() in updateKey(), and using removeKey() in EditTranslationsModal.

@jeremydw jeremydw force-pushed the fix/translation-metadata-undefined-value branch from 2cd1d64 to 0e828c4 Compare March 23, 2026 21:45
@jeremydw jeremydw requested a review from stevenle March 23, 2026 21:46
return;
}
this.pendingUpdates.set(key, value);
if (value === null || value === undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a little tempted to say null should remain (only undefined should be deleted). are there any use cases you can think of where we should support null? i'm thinking maybe for querying purposes since if the key is there it'll be search indexed whereas if the key is removed we won't be able to query for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah; wasn't sure about this one. let's scope the change to just undefined for now and follow up with the null change later.

@jeremydw jeremydw force-pushed the fix/translation-metadata-undefined-value branch from 0e828c4 to f582d44 Compare March 23, 2026 22:00
@stevenle stevenle merged commit a104725 into main Mar 23, 2026
1 check passed
@stevenle stevenle deleted the fix/translation-metadata-undefined-value branch March 23, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants