alexcorvi / apexo

A web/desktop application to manage your dental clinic practice.
https://apexo.app
MIT License
84 stars 46 forks source link

Sync Issue with CouchDB #181

Open mohamadRoc opened 4 years ago

mohamadRoc commented 4 years ago

while I was trying to debug & reproduce the PouchX bug, I found two Issues related to PouchX and syncing data to CouchDB, it could be related to the reported bug.

Describe the bug If you remove a patient who has multiple appointments e.g (8 appointments), you will notice two issues,

1- the deleted patient and related appointments won't sync to CouchDB until you click on the top right sync button. 2- after you click on sync button, you will notice not all the appointments will be removed from CouchDB, only 4 of the 8 will be removed, and 4 appointments will stay at CouchDB.

To Reproduce Steps to reproduce the behavior:

  1. open web.apexo.app and restore this file apexo-backup-7-Aug-20.zip
  2. open (CouchDB/_utils) to see the changes in docs numbers, there should be 2 patients and 3 appointments
  3. go back to apexo and delete "Sara Beam" who has two appointments.
  4. check the numbers in CouchDB you will notice no changes until you click on re-sync button at the top right. (First Issue)
  5. after re-sync go check the CouchDB you will notice only one appointment is removed, instead it should delete the two appointments of "Sara Beam" (Second Issue)

Desktop (please complete the following information):

It could be related to reported bug at PouchX, if its not I will do my best to reproduce it after fixing this issue.