-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Confusing error when passing invalid ID to synonym upsert()
#233
Comments
The problem as you correctly mentioned is the |
Could you try this with v2.0.0-6 of typesense-js? We automatically url-encode special characters in that version, so this shouldn't happen. |
Description
When using the Synonym
upsert()
function in the Typesense JS SDK, invalid IDs throw an ambiguous error which doesn't give any clue on what the issue is or how to fix it.Steps to reproduce
Edit: After some more testing, it seems that the slash ("/") is the problem, using umlaute ("ä") or non-breaking spaces as the ID seems to work just fine.
Expected Behavior
If the ID needs to match a certain format, I'd expect a informative error to be thrown, something the lines of "Invalid ID. IDs have to match format ".
As an alternative, invalid IDs could automatically be coerced to a valid one, or given a UUID. Though a useful error is probably more expected.
Actual Behavior
I get an error that caused us some confusion on how to fix it:
Metadata
Typesense Version: Server 27.1; JS SDK 1.8.2
OS: macOS 15.0
The text was updated successfully, but these errors were encountered: