Skip to content

Conversation

djbalin
Copy link
Contributor

@djbalin djbalin commented Mar 12, 2025

Similar to this PR I opened in the convex-backend repo

Makes the error message thrown by .unique() more useful. Now, the _id's of the first two documents returned by the unique() query are printed in the error message. This is very helpful to the user in identifying and resolving incorrect data.

The wording in the error message has been changed such that it is identical to the error thrown by .unique() from convex-backend (slightly confusing that the same error has different error messages based on where it's thrown from).

Feel free to change my wording in the error message - but in my opinion it should be clear that the document id's printed are not all the documents returned by the unique() query but just the first two.

Note: I did not build and test this change locally, and intellisense did not help me in verifying that _id does indeed exist on those objects, so please verify before merging!


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ianmacartney ianmacartney merged commit e493954 into get-convex:main Mar 12, 2025
1 check passed
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.

3 participants