Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.49k stars 589 forks source link

Data duplication when synchronizing with the remote server #1664

Open Zebedeu opened 1 year ago

Zebedeu commented 1 year ago

Hello,

I'm facing an issue of data duplication when synchronizing with a remote server using WatermelonDB. Every time I sync the data, previously synchronized records are inserted again into the server, resulting in unwanted duplicates.

I have reviewed my synchronization logic and believe the issue is not related to it. Additionally, I have checked if the synchronization status is being updated correctly on each record and if the records have unique primary keys.

I am using React Native in conjunction with WatermelonDB. I would like to know if anyone has encountered a similar problem and if anyone has any suggestions or solutions to resolve this data duplication issue during synchronization.

Thank you in advance for any help or guidance you can provide.

Best regards

carlos-cne commented 11 months ago

I think that would be better if you shared a piece of code showing what you are doing on the synchronize function. Could you do it?

lucaswitch commented 10 months ago

Not duplicating here on 0.27

Em sex., 3 de nov. de 2023 00:44, Carlos Queiroz @.***> escreveu:

I think is better if you share a piece of code showing what you are doing on the synchronize function. Could you do it?

— Reply to this email directly, view it on GitHub https://github.com/Nozbe/WatermelonDB/issues/1664#issuecomment-1791858490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5NZ4YLFNRPMLWO5IMVFWDYCRSB7AVCNFSM6AAAAAA4YFTWZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRHA2TQNBZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>