road86 / bahis-desk

Desktop application for BAHIS2
GNU General Public License v3.0
2 stars 1 forks source link

CSV data sync errors #50

Closed ChasNelson1990 closed 3 months ago

ChasNelson1990 commented 1 year ago

Bug Description

Whilst CSV data syncing is occurring, a load of SQLite errors land in the logs. This could be the cause of missing local data for users?

To Reproduce

  1. Log in
  2. Sync
  3. Watch the logs
  4. See errors

Expected Behaviour

No response

Additional Context

No response

ChasNelson1990 commented 1 year ago

@sharful09 - these are the SQLite issues you and I spoke about earlier today. Are you hoping to put a PR in for v2.2.x (i.e. this week?). If not, as these are non-breaking, I propose to remove this from the milestone and mark as "won't fix" for the time being.

shaarful commented 1 year ago

@ChasNelson1990 I saw two errors while syncing.

Error 1:

image

While first-time login the new database is created on SQLite db in the local machine. The tables definition gets from this table core.database_static_script in bahis-serve. I saw there is duplicate definition therefore this error is happening.

Error 2:

image

There are 3 tables missing in the local database named:

  1. bahis_patient_registrydyncsv_live_diagnostic_rapid_table
  2. bahis_patient_registrydyncsv_live_diagnostic_parasite_table
  3. bahis_patient_registrydyncsv_live_diagnostic_ear_table

Actually not missing these tables are there but the named missing with diagnostic this word. like, this bahis_patient_registrydyncsv_live_diagnostic_rapid_table exist with this bahis_patient_registrydyncsv_live_rapid_table name. I talked with @taifur-bau Taifur Bhai regarding this he told me both are the same table only the name difference.

ChasNelson1990 commented 1 year ago

And just to check, this is true for both Dev and prod? Can you propose a set of changes for us to test in Dev? Just put the procedure here as a comment for now and then we can try it next week after the release of 2.2.x?

shaarful commented 1 year ago

I got these errors from the electron log in the console. How can I access the console in the prod version?

To solve the first error we need to remove duplicate rows from core.database_static_script in this table.

for the second error, we need to go more deep into the code to find out why the table name is different

shaarful commented 1 year ago

I have checked in prod also getting the same error.