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

Having note open across suspends or internet connection loss led to unsaved data #122

Open
jancborchardt opened this issue Jul 28, 2017 · 11 comments
Labels
bug Something isn't working feature: backend Related to the PHP backend feature: editor Related to generic parts of the editor, e.g. loading/saving notes help wanted Complex issue or we don't know how to fix it

Comments

@jancborchardt
Copy link
Member

jancborchardt commented Jul 28, 2017

I had the notes app open in a tab since yesterday. Today I continued on the same note and finished what I was writing. After encountering the copying issue #121 I checked in the Notes folder of Files, and found the note to be last saved 21 hours ago.

After having copied the new text somewhere else, I refreshed the page and the new text was gone. So this is quite a big issue. ;) Maybe we should have a constant heartbeat to the server, or force a reconnection? Not sure if we do something special in the texteditor app here.

cc @nextcloud/notes @nextcloud/javascript


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@BernhardPosselt
Copy link
Member

AFAIK its a known issue, talk to @LukasReschke

Session or tokens seem to time out although a heartbeat is present

@korelstar
Copy link
Member

I think there are two posibilities:

  1. Provide/fix long-lasting sessions by the server (other apps can benefit from this, too)
  2. Implement some kind of offline mode in the notes app (we had a discussion about this already, see offline support #11)

@BernhardPosselt
Copy link
Member

BernhardPosselt commented Jul 28, 2017

Solution should be to always store a note backup in localstorage (which could be too small in some cases, indexeddb or ask user to increase storage?) together with its modified time in unix time in milliseconds

If a note update is sent to the server, the server will compare the modified timestamps of the sent one and the one on the disk. Only if the sent timestamp is greater or equal, the note will be updated, otherwise the contents of the note on disk will be returned.

You could ofc also offer a diff and let the user choose which one to keep if the sent timestamp is older than the version on the server.

@korelstar
Copy link
Member

That would be nice. Is there anyone who want to implement this?

@korelstar korelstar added the help wanted Complex issue or we don't know how to fix it label Sep 1, 2017
@Vlad-M-1
Copy link

This issue with data loss on connection problems is quite important. Currently this app is not a safe home for all our data like it's stated on the main page. But I'd like it to be.
I'd even crowdfund $70 to get it solved :) For example, I can send them to one of maintainers, and that person could reward someone after solution is approved.

@nextcloud nextcloud deleted a comment from jospoortvliet Jun 5, 2018
@nextcloud nextcloud deleted a comment from ChristophWurst Jun 5, 2018
@nextcloud nextcloud deleted a comment from jospoortvliet Jun 5, 2018
@nextcloud nextcloud deleted a comment from skjnldsv Jun 5, 2018
@jancborchardt
Copy link
Member Author

Removed the organizational comments about Bountysource – you can now donate to this issue (and others) at https://www.bountysource.com/issues/47696500-having-note-open-across-suspends-or-internet-connection-loss-led-to-unsaved-data 👍

@korelstar
Copy link
Member

There is a similar issue in the mail app: nextcloud/mail#121 - I think the fix should be equal (currently, it is unfixed for some years).

Just for the protocol: a suggested fix in the server (nextcloud/server#6360) did not improve the situation for this app.

The suggested offline-mode (see #122 (comment)) would be nice, but it has another goal and should be discussed in another issue. I don't think that we need this to solve the original issue, here.

@tnyeanderson
Copy link
Contributor

I think we should implement a service worker for some kind of offline mode. This would also make it easier to turn this into a PWA, which I was going to suggest in another issue.

@korelstar korelstar added feature: backend Related to the PHP backend feature: editor Related to generic parts of the editor, e.g. loading/saving notes labels May 24, 2019
@juliusknorr
Copy link
Member

If the request after reconnecting failed due to a CSRF token issue this should mostly be addressed now that nextcloud-axios is using the refetched token: https://github.com/nextcloud/nextcloud-axios/blob/master/lib/interceptors/csrf-token.ts

@jancborchardt Do you still see this happening? 😉

@mobamoba
Copy link

I see this happening with the most recent update of Notes (4.92). I never had it before but it's happening all the time now.

@sunkup
Copy link

sunkup commented Sep 29, 2024

Still happening. Notes v4.11.0.

After having the notes editor open for a while (I think 2-3 hours are enough) I can make changes in the document, which are not recognized anymore and lost on page refresh. The little checkmark does not show the "unsaved" dot and the version history is not updated anymore - even when actively clicking the save checkmark - see screenshot.

Screenshot

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: backend Related to the PHP backend feature: editor Related to generic parts of the editor, e.g. loading/saving notes help wanted Complex issue or we don't know how to fix it
Projects
None yet
Development

No branches or pull requests

8 participants