Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly escape field paths with multiple backslashes or backticks (#2259) #2261

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

MarkDuckworth
Copy link
Contributor

@MarkDuckworth MarkDuckworth commented Dec 13, 2024

Merging community PR #2259 from @albertnis to main.

Fixes #2019 🦕

…cks (#2259)

Previously, only the first backslash and backtick was being escaped. This broke `update` and `set (merge)` calls when a field path contained multiple backslashes.

`replaceAll` is an alternative here, but I think a global regex has better compatibility with older versions of Node.
@MarkDuckworth MarkDuckworth requested review from a team as code owners December 13, 2024 21:11
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: firestore Issues related to the googleapis/nodejs-firestore API. labels Dec 13, 2024
@MarkDuckworth MarkDuckworth added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Dec 13, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 13, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 13, 2024
@dconeybe dconeybe merged commit 7056ba7 into main Dec 17, 2024
17 checks passed
@dconeybe dconeybe deleted the community/albertnis/fix-escape branch December 17, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FieldPath only escapes the first \ and '`', resulting in INVALID_ARGUMENT response
4 participants