-
Notifications
You must be signed in to change notification settings - Fork 174
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
only raw queries work due to "invalid uuid". Uuid v7 are rejected #1153
Comments
I now built a branch of the app where there are no references to other tables in app_states.
|
I now built another branch of the app. This time the user_email is the primary key of the app_states table. Thus there is no way there could be an offending uuid. This would probably not work for the app but I just built this to test this issue. What is nice:
BUT:
So now I am completely at a loss how to get my project working again 🤷 This project has always been using v7 uuids. Is it possible that this (suddenly) causes an issue? |
I now built another branch of my project. This time all uuid's were converted to text. And the queries work again. So it really seems that the uuid's are the culprit? |
So I now built a branch of the project using uuid v4 instead of uuid v7. It works! So my interpretation is that there must be a place in the implementation of electric-sql / prisma or whatever that checks the validity if uuid's and unfortunately rejects v7 uuid's. This must be new as my app has been using them for months and so far it has worked. By the way, to create uuid v7 I was using:
|
It seems that zod is not the culprit. I tested two of my v7 uuid's here: https://codesandbox.io/p/sandbox/js-playground-forked-dvtnl3?file=%2Fsrc%2Findex.js%3A7%2C33 (watch the values logged in dev tools) |
I think I know whats happing, Zod seems to have changed how it validates UUIDs, version 3.22.4 correctly validates UUID V7 whereas 3.21.4 (currently specified by Electric) rejects them. I forked your sandbox and changed the Zod version to match that in your projects package_lock.json and it rejects them: https://codesandbox.io/p/sandbox/js-playground-forked-dvtnl3?file=%2Fsrc%2Findex.js We obviously need to change the version of Zod that's specified. @kevin-dp could you take a look, I know you had concerns about Zod versions before? |
YESSSSSS! I installed the current version of zod in my project and now the v7 uuid's are working just fine. Thanks so much @samwillis |
We pinned Electric to Zod version 3.21.1 because something changed in later versions of Zod that can cause the generated client to contain type errors, cf. #700 for more information. |
So it seems we are all waiting for a new version of zod as the last one happened in oktober 2023 and a (hopefully) solution was merged three weeks ago. |
@kevin-dp could we have a clearer section in our docs about pinned dependencies? I.e.: "you must use the pinned versions of these libraries ...". |
In a previously working app I am suddenly no more able to query data.
Or rather: it seems that only raw queries work.
This is my boiled down component:
When this component runs the output in the console is:
So it seems that:
db.rawQuery
returns the expected data (also: postgres contains the data as well, so it seems that sync is working correctly)db.rawQuery
works as expectedI have been implementing auth and the new version 0.10 of electric-sql since yesterday. As part of this the syncing now also uses a where clause (only the data of the user with the email according to auth).
So there could be other reasons. But I feel that it may be due to the update to version 0.10.0. I am now running 0.10.1 but the error persists.
Edit: These are the table definitions:
...and the prisma client:
...here the client schema:
I repeatedly rebuilt all the data by recreating the db from scratch including all its volumes, migrating it, generating the client and reloading it after clearing all client side data.
The errors mention two things:
Edit: I just tried downgrading electric to 0.9.4 (docker) and 0.9.6 (app) and the errors persist. So not an error caused in the version uprade.
The text was updated successfully, but these errors were encountered: