-
Hi, Thanks for this awesome project! I am trying it out by coding a small React / Express app. The Express server is virtually identical to the one in Sometimes changes in the React client cannot be seen in the serverside DB, even though the Server Sent Events stream seems to be open and working. I'm having a hard time debugging this, I am then wondering if either the client or server library could give some more information on the data replication status, and why it would not be working. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Sure, there should be some logging to the client and server paths. I'm thinking of adding Winston to both client and server and having it enable when in dev mode. Also, do you have a repro of this issue I could look at? |
Beta Was this translation helpful? Give feedback.
-
For now I don't, the server DB sometimes gets out of sync and I don't understand when this happens yet. I'll eventually try to look into this and make a minimal reproduction. |
Beta Was this translation helpful? Give feedback.
What about
SELECT * FROM expenses__crsql_clock
,SELECT * FROM expenses
andSELECT * FROM crsql_changes
on the server db?I see your primary keys look to be auto increment. That's probably not going to work as many devices will assign the same key to rows that are actually not intended to be the same.
The primary key should be some sort of UUID (e.g., nanoid) or something related to the identity of the row.