DavidMStraub / gramps-web-sync

Development version of a Gramps addon to synchronize Gramps Web with Gramps Desktop
GNU General Public License v3.0
11 stars 2 forks source link

Reset remote to local and Reset local to remote has the same result #30

Open marcmoiagese opened 2 weeks ago

marcmoiagese commented 2 weeks ago

Hi,

About a year ago, I started using the Gramps desktop application to store all the information I collect about my family. I deployed Gramps Web to allow my family members to see what I have found, but its users do not have permissions to modify anything. I use your plugin to update what I have locally to the web. The problem is that more often than I would like, it starts saying that things will be deleted that I haven't deleted, and that things that have been modified on both sides will be synchronized, which hasn't happened. In this case, what it ends up doing is putting what is on the web locally. I have tried using the "Reset remote to local" and "Reset local to remote" options, and the result when this happens ends up applying the changes it indicates in all cases. The only workaround I have found is to edit each of the items it is warning me about; for example, what I do is remove the tag, save it, and put it back. But of course, sometimes there are more than 100 items, and it becomes tedious. I would like to be able to simply overwrite what is on the web by forcing what I have locally.

Here i can put an example that i have just few minutes ago, in this case i need run your plugin 3 times. The first time show lot of changes

Example

i apply my "work arround"

Example-2

And finally this is the real content to upload

Example-Fine

i work in windows 10 on local and gramps web is the offical docker

DavidMStraub commented 2 weeks ago

It's hard to say what's going wrong here. Obviously, that's not the intended behavior, but also not something I have encountered so far.

Please start by sharing the entire version info from the Gramps Web settings section as well as your Gramps Desktop and Sync Addon versions. Next, I suggest to start with a fully synced state and, as soon as unexpected changes are shown by the sync addon, to export a Gramps XML in desktop and web. These can be used for further debugging.

marcmoiagese commented 2 weeks ago

Hi,

Gramps Desktop version is:

GRAMPS: AIO64-5.2.0-r1-6167151 Python: 3.11.8 BSDDB: 6.2.9 (6, 0, 30) sqlite: 3.45.1 (2.6.0) LANG: es_ES.UTF-8 OS: Windows 10

But i have this problem with previous versions also. Regarding Gramps web i have following version

Gramps 5.2.2 Gramps Web API 2.3.0 Gramps Web Frontend 24.5.0 Gramps QL 0.3.0 locale: en multi-tree: false task queue: true

But i started with oldest versions and i have this issue with all of them. Regarding the plugin version show:

Plugin name: Gramps Web Sync [2]

Description: Synchronizes a local database with a Gramps Web instance. Version: 1.1.1 Authors: David Straub Email: straub@protonmail.com Filename: grampswebsync.py

Please note that I have also redeployed the entire Gramps Web on occasion, as I have been trying, especially with each version change, to see if this bug was resolved. Restoring to the desktop version from backup and then synchronizing everything to Gramps Web.

DavidMStraub commented 2 weeks ago

Thanks! That does look good. So now it would be great to see after unexpected changes are found, what the differences between the two XML files are, and also which timestamp the webapisync.ini in your Gramps desktop plugin directory shows.

marcmoiagese commented 1 week ago

Hi,

I just reproduced the error again, i modified 2 existent persons, and when i try upload to the web tree this is the following result:

changes

I have marked in red the change that is real, the rest is the bug that in this case are few items that it says it has to delete or modify, now selecting any option always does the same, it overwrites locally and on the web what is in the screenshot

webapisync.ini located on C:\Users\marc\AppData\Roaming\gramps\gramps52\plugins show following content, i changed user and site details

;; Gramps key file
;; Automatically created at 2024/06/30 18:39:50

[credentials]
timestamp=1719765346.149732
url='https://site.com/'
username='user'

I did an export from Gramps Web and another from Gramps desktop, and when I did a diff between the two, I got an enormous amount of changes that don't match reality, since I see changes that have been in the tree for months appearing as new.

marc@DESKTOP-H7AO43K:~/codi/grampsdiff$ diff -u desktop-export-20240630165511.gramps web-export-20240630165511.gramps | wc -l 102124

The strange thing is that if I now go to the items with the IDs it says have been deleted, or to those that have been modified simultaneously, and I remove the tag, save, and reapply it, it then detects that everything is fine and will only show the last two changes to upload.

DavidMStraub commented 2 days ago

The strange thing is that if I now go to the items with the IDs it says have been deleted, or to those that have been modified simultaneously, and I remove the tag, save, and reapply it, it then detects that everything is fine and will only show the last two changes to upload.

Sorry, I didn't understand that part. Which tag did you remove where?

The diff is not very useful because the XML files could be identical even if the text files are very different, e.g. the order of exported items doesn't matter.

In a situation where the "wrong" changes show up, please post the full XML code of the relevant element here, from both sides. E.g. in the example screenshot, you could choose I5318.

If it claims I5318 was deleted remotely, it means the object doesn't exist on Gramps Web, but exists locally. This should be easy to check by looking for it in the XML.