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

Cannot find document when document id contains non-ascii characters #999

Open
CorieW opened this issue Dec 30, 2024 · 0 comments
Open

Cannot find document when document id contains non-ascii characters #999

CorieW opened this issue Dec 30, 2024 · 0 comments
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API.

Comments

@CorieW
Copy link

CorieW commented Dec 30, 2024

An issue was created for this in firebase-functions-python #220, but I believe this is an issue with this project, so I'm creating an issue here.

Issue

My document id:

H67iEkcHx6Nicg5eoZbmxARLyJo2_KoX4bc4jGmTKwSGLI9GBdF46Hbt2_中餐

The last two characters are Chinese characters.

Relevant code:

event.data.after.reference.update() (here)

Error message:

google.api_core.exceptions.NotFound: 404 No document to update: projects/{project_name}/databases/(default)/documents/{collection_name}/H67iEkcHx6Nicg5eoZbmxARLyJo2_KoX4bc4jGmTKwSGLI9GBdF46Hbt2_中�"

Notes

The issue could be that the string "H67iEkcHx6Nicg5eoZbmxARLyJo2_KoX4bc4jGmTKwSGLI9GBdF46Hbt2_中餐" is being converted into "H67iEkcHx6Nicg5eoZbmxARLyJo2_KoX4bc4jGmTKwSGLI9GBdF46Hbt2_\344\270\255\351\244\220" inside the event.data.after.reference.update function. Notably, the part "\344\270\255\351\244\220" is an octal representation of the UTF-8 encoding for 中餐. To convert it, each octal sequence (e.g. \344) can be converted into hexadecimal to get \xe4\xb8\xad\xe9\xa4\x90 which is the UTF-8 byte sequence for 中餐.

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Dec 30, 2024
@CorieW CorieW changed the title Trigger cannot find document when document id contains non-ascii characters Cannot find document when document id contains non-ascii characters Dec 31, 2024
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/python-firestore API.
Projects
None yet
Development

No branches or pull requests

3 participants