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

Problems with revisions / versions #2197

Closed
Perkolator opened this issue Dec 16, 2019 · 5 comments
Closed

Problems with revisions / versions #2197

Perkolator opened this issue Dec 16, 2019 · 5 comments
Labels
bug It's a bug

Comments

@Perkolator
Copy link
Contributor

Environment

Joplin version: Windows 1.0.175, Android 1.0.312
Platform: Windows, Android
OS specifics: Windows 8.1(.1), Android 9

Steps To Reproduce

  1. On mobile, exit Joplin & close it from the system app switcher. (might not be necessary but let's make sure that "revision worker" starts counting its "idle interval" when we start (I don't know the details how this system works under the hood, so my description here might not be accurate, or it's confusing, sorry)
  2. Open Joplin on mobile and create new note.
  3. Add whatever title to note.
  4. Write one character to note, e.g. "A".
  5. Wait for the auto-save feature to complete after a second or two (the "diskette" button in toolbar goes "grey").
  6. Write more characters to the note, for example, ending with "Abcdefgh" note text.
  7. Exit editing view and then note view.
  8. Sync mobile (there might be an auto-sync going on, or it already finished, but do it anyways).
  9. Wait about 5 minutes.
  10. Edit the note in mobile, remove characters from the note, e.g. "defgh" from the end, with note ending up with just "Abc" text.
  11. Exit editing view and then note view.
  12. Sync mobile (there might be an auto-sync going on, or it already finished, but do it anyways).
  13. Wait about 15 minutes. (by this, we make sure the "revision worker" ends its idle interval)
  14. Sync mobile.
  15. Open Joplin on desktop and sync.
  16. On desktop, go to Note History (i-icon -> "Previous versions of this note")

= There's only one revision/version which shows only "A" character in the note text! There seems to be, at least, 2 problems with the "revision worker/version system(/auto-save+auto-upload-sync)":

  1. The "auto-save" feature on mobile seems to be triggering an immediate save & sync (only upload, it's not fetching changes) & revision creation when it first time (after "revision worker" idle period has ended. or first revision hasn't been made yet after opening Joplin) auto saves the note when the user is writing it. There have been many requests to remove/disable this "auto-save" feature for many reasons, e.g. it effectively prevents discarding modifications to note if the user makes an error editing the note. This case with creating a version/revision too quickly is another reason why the feature should be removed/modified. And more so because of the next problem:

  2. Subsequent modifications within the "revision worker" idle period (15min?) are lost.

Breakdown of what happened during the above steps to reproduce:

  1. Note with text "A" char is saved + upload-synced + versioned.
  2. Subsequent immediate modification of note text with added "bcdefgh" text is saved + upload-synced BUT not versioned.
  3. Subsequent modification after 5 minutes, "defgh" removed from note text is saved + upload-synced BUT not versioned.

What versions / revisions were made:

  1. Revision with text "A".

What versions / revisions should have been made in an ideal situation:

  1. Revision with text "Abcdefgh".
  2. Revision with text "Abc"
    • If you make any kind of additional modification to the note on mobile and sync it to desktop, you won't find this revision from the revision history, the revision history will show only the first "A" revision, and then a 2nd revision with the additional modification you just made.

I have not tested extensively how revisions/versions work in the desktop but I guess it's the same situation there, there's a "revision worker" there too and it has an idle period too. The only difference to mobile seems to be that desktop doesn't have immidiate "auto-save+upload sync", it triggers after 30 seconds of inactivity after the last note modification (this feature can't be turned off, and the auto-sync interval in settings doesn't apply to this).

There have been reports about some last character(s) missing sometimes after a sync. There might be a chance that the desktop "30 sec auto-save + auto upload sync" is the culprit. I haven't been able to reproduce the problem consistently yet. I believe it has something to do with timing, i.e. when the auto-save/auto-upload-sync starts or during its procedure and editing the note at the same time. I don't know if I have understood the system correctly, but I think that when the auto-save/auto-upload-sync starts or during it, Joplin makes a "snapshot" of the note text and upload syncs that, but in the same time user has added something to the note and the note view is not updated after the upload-sync. Only after "regular/full" sync happens (upload+download), then the note text is fetched that Joplin only upload-synced, and the note view is updated, and the late modification that happened during the auto-save/auto-sync is removed from the view. I'm not sure about this but I think that this hypothesis would be worth checking out.


In summary IMO:

  1. The revision system should be revised. I know, it's a hard suggestion, "how to do it then?". Maybe:

    1. On mobile, regardless how auto-save/sync is performed:
      • Create revision every time a user exits the edit view and the note has changes compared to the last revision?
      • Create revision every 1-5 minutes(?) of inactivity when the edit view of a note is open and the note has changes compared to the last revision?
    2. On desktop, regardless how auto-save/sync is performed:
      • Create a revision every time user selects another note and the previously selected note has changes compared to the last revision?
      • Create revision every 5-15 minutes(?) of inactivity when the selected note has changes compared to the last revision? (I guess the system works about like this currently, only on certain interval regardless of user inactivity)
      • Create a revision every time user does a manual sync/save. or the automatic sync schedule actives (not the 30 seconds auto-save/sync, which possibly could be removed?), and the note(s) has changes compared to the last revision?
  2. Auto-save+auto-upload-sync on mobile while editing should be removed/enhanced. Maybe an option to auto-save/sync or a prompt to save when exiting the note editing view. And making the option to auto-save/sync to activate later than 1 second of inactivity.

  3. Making sure that user modifications during auto-saving/sync (if that's really the culprit of missing texts/chars) are not discarded. (sorry that I don't have reproducible steps for this, I have tried for long now)

@Perkolator Perkolator added the bug It's a bug label Dec 16, 2019
@stale
Copy link

stale bot commented Mar 15, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@stale stale bot added the stale An issue that hasn't been active for a while... label Mar 15, 2020
@Perkolator
Copy link
Contributor Author

I'd hate to see this get closed by a bot that only makes a decision based on timeframe.

@stale stale bot removed the stale An issue that hasn't been active for a while... label Mar 15, 2020
@laurent22
Copy link
Owner

For feature requests please open a discussion about it on the forum.

@Perkolator
Copy link
Contributor Author

This is not a feature request. My first post clearly underlines problems with the revision/version system.

@laurent22
Copy link
Owner

It's not entirely clear to me if it's a bug or a feature. The note revision service saves revision according to various rules, so what might look like a bug could actually be expected. There's info about these rules in the original pull request and blog post.

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

2 participants