Giter Site home page Giter Site logo

Comments (11)

samwillis avatar samwillis commented on June 8, 2024 1

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?

from electric.

kevin-dp avatar kevin-dp commented on June 8, 2024 1

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.

from electric.

linear avatar linear commented on June 8, 2024

VAX-1781 Suddenly only raw queries work

from electric.

barbalex avatar barbalex commented on June 8, 2024

I now built a branch of the app where there are no references to other tables in app_states.

unrecognized keys does not appear in the errors any more. But Invalid uuid is still claimed.
Also: The query for projects does (still) not return any data either...

from electric.

barbalex avatar barbalex commented on June 8, 2024

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:

  • no error is thrown
  • app_states are correctly queried

BUT:

  • no other data is queried using typed queries (all use an uuid primary key)
  • using raw queries, other data is returned. As before with the app_states
  • even though no data is returned, no error is thrown

So now I am completely at a loss how to get my project working again 🤷
Well, asides from refactoring all 982 queries to use raw versions...

This project has always been using v7 uuids. Is it possible that this (suddenly) causes an issue?

from electric.

barbalex avatar barbalex commented on June 8, 2024

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?

from electric.

barbalex avatar barbalex commented on June 8, 2024

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:

from electric.

barbalex avatar barbalex commented on June 8, 2024

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)

from electric.

barbalex avatar barbalex commented on June 8, 2024

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

from electric.

barbalex avatar barbalex commented on June 8, 2024

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.

from electric.

thruflo avatar thruflo commented on June 8, 2024

@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 ...".

from electric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.