Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cloud-based library sync #1042

Closed
anssilaitila opened this issue Jan 23, 2018 · 9 comments
Closed

[Bug] Cloud-based library sync #1042

anssilaitila opened this issue Jan 23, 2018 · 9 comments

Comments

@anssilaitila
Copy link

I've been successfully using a cloud-based library (Dropbox) for maybe a year now, but a few weeks ago strange things started to happen. When I save the library using one of my devices and then open it using another, the following notification appears (everything normal so far):

screenshot 2018-01-23 09 33 31

Now when I choose to "Reload From Disk", the library loads from Dropbox and everything seems to be fine. But if I then close Quiver and open it again, all the changes are gone and the library on Dropbox has been replaced with the older version of the library (which was open previously on the current machine). So the current version of the library is lost and the "Reload From Disk" didn't work correctly. As far as I understand it should and it previously has.

@anssilaitila anssilaitila changed the title [Bug] Issue with cloud based library sync [Bug] Cloud based library sync Jan 23, 2018
@anssilaitila anssilaitila changed the title [Bug] Cloud based library sync [Bug] Cloud-based library sync Jan 23, 2018
@ylian
Copy link
Member

ylian commented Jan 23, 2018

This dialog pops up when you have the same note open on two synced devices and some changes are made on one device. It's best to avoid such use scenarios, as Dropbox doesn't resolve file conflicts but merely create a conflicted copy of the note.

@anssilaitila
Copy link
Author

Yes, but doesn't Quiver function somewhat illogically here? If I choose to reload from disk, the library reloads and I see the updated library opened. I might even do some changes, but if I don't especially save the library, all changes are lost when I close the application (no dialog here?) and also the library on Dropbox is overwritten with the outdated version of the library. Yes, it was supposed to be saved, but with the version currently open in the application.

I think the fact that the library is overwritten with outdated version is quite disturbing and will cause a loss of data. This is quite a new "feature" (a few weeks maybe) and hasn't been there previously.

@tkeeler33
Copy link

I have come across a similar issue with syncing via devices, not sure if this is related.
In my case I have DeviceA and DeviceB syncing with the same note loaded.

  1. On DeviceA: Note content is updated
  2. DeviceB receives the change/popup and Reload from Disk is chosen
  3. DeviceA sometimes receives a reload popup - although no changes were made on DeviceB after the reload occurred.
  4. Choosing reload on DeviceA wipes out the content changes in Step 1.

It sounds like there may be a race condition between the syncing of content.json and meta.json and how Quiver detects/reloads this data. I think this is definitely a bug, I can reproduce data loss consistently here.

I think it should just automatically reload based on the latest changes from the device. This is how other software like SublimeText 3 handles syncing via Dropbox.

@gotascii
Copy link

I was troubleshooting this same issue this morning and discovered a consistent series of steps to reproduce this issue every single time, as well some additional insight as to the cause. The steps are very similar to @tkeeler33's however I noticed one additional bit of information.

Steps:
Given two devices DeviceA and DeviceB that share the same library via Dropbox.
Close Quiver on both devices.
On DeviceA, open Quiver.
On DeviceA, create a new note and add distinct content (e.g. the letter A).
At this point the meta and content files on disk on DeviceA look like the following:

meta.json:

{
  "created_at" : 1523892811,
  "tags" : [

  ],
  "title" : "test",
  "updated_at" : 1523894322,
  "uuid" : "long-string-of-stuff"
}

content.json:

{
  "title": "test",
  "cells": [
    {
      "type": "text",
      "data": "A"
  ]
}

Allow Dropbox to fully sync.
Checking the contents of the files on disk on DeviceB yields the exact same content as above (as one would expect given a fully synced Dropbox).
On DeviceB, open Quiver.
The note with be displayed in the app on DeviceB with the content that matches the disk contents.
On DeviceB, change the content of the note (e.g. change the letter A to a B).
Now, the contents on disk on DeviceB are as follows:

meta.json:

{
  "created_at" : 1523892811,
  "tags" : [

  ],
  "title" : "test",
  "updated_at" : 1523894449,
  "uuid" : "long-string-of-stuff"
}

content.json:

{
  "title": "test",
  "cells": [
    {
      "type": "text",
      "data": "B"
  ]
}

Note that the updated_at and data have changed, as expected.
Allow Dropbox to fully sync.
The pop up will show on DeviceA.
At this point, checking the contents of the disc on DeviceA yields the exact same content as DeviceB, as expected given a fully synced Dropbox.

In the following step, I think Quiver does something unexpected.

On DeviceA, when I click Reload From Disk,
in the editor window, the content from disc is displayed (i.e. the letter B is shown in the editor window of the running application).
HOWEVER, when I inspect the contents on the disc of DeviceA, they contain the following:

meta.json:

{
  "created_at" : 1523892811,
  "tags" : [

  ],
  "title" : "test",
  "updated_at" : 1523894449,
  "uuid" : "long-string-of-stuff"
}

content.json:

{
  "title": "test",
  "cells": [
    {
      "type": "text",
      "data": "A"
  ]
}

NOTICE: updated_at has not changed, yet what appears to be the previous content contained in the editor window of DeviceA has been written to disc! Clicking Reload From Disk should never write anything. However, it is writing something and that, of course, gets synced by Dropbox, which then causes DeviceB to show the popup, etc, etc.

My question, summarized, is: Why did the contents of the files on disk on DeviceA change when I clicked Reload From Disk? Intuitively, it seems like Quiver should have taken the contents of the files on disk and made the editor window display that content.

Hopefully this helps! I'd love to get this fixed. Everything else about Quiver is absolutely stellar for my use cases :)

@amouchinski
Copy link

It looks like the latest release 3.1.3 is affected by this issue. I've been successfully using Dropbox to sync notes between two devices for quite some time until recently, perhaps till v3.1.2 or 3.1.1. Now attempts to sync changes via "Reload From Disk" lead to latest notes being overwritten with whatever version the syncing device had before the attempt.

Very annoying issue because I can no longer trust Quiver important data and the ability to sync is important to me.

Please LMK if I can help with troubleshooting. Thanks!

@ylian
Copy link
Member

ylian commented Jul 23, 2018

This will be fixed in the next update. Aiming to push it out this week.

@amouchinski
Copy link

Thank you!

@amouchinski
Copy link

Still hope to see the update released!..

@ylian
Copy link
Member

ylian commented Nov 27, 2018

Fixed in 3.2.1. The dreadful "contents have changed on disk" dialog is history. Quiver now automatically reloads the opened notes to the latest version.

@ylian ylian closed this as completed Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants