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

NC26 Browser Popup when leaving Notes App whitin a note #987

Closed
apg1980 opened this issue Mar 22, 2023 · 9 comments · Fixed by #1078
Closed

NC26 Browser Popup when leaving Notes App whitin a note #987

apg1980 opened this issue Mar 22, 2023 · 9 comments · Fixed by #1078
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced

Comments

@apg1980
Copy link

apg1980 commented Mar 22, 2023

Please make a clear and concise description of what the bug is. Please note, that issues with the Android app have to be reported under https://github.com/stefan-niedermann/nextcloud-notes/issues and issues with Nextcloud's Text app have to be reported under https://github.com/nextcloud/text/issues .

Steps to reproduce

1.open notes and write a note
2. click on files app or another
3. browser popup appears whit hint unsafed data gets lost

Expected behaviour

Data is safed

Actual behaviour

Tell us what happens instead
grafik

Screenshots

If applicable, add screenshots to help explain your problem.

Server

Please complete the following information.

  • Notes app version: 4.7.1
  • Nextcloud version: 26
  • OS: ubuntu
  • Web server: nginx
  • PHP version: 8.1
  • Database: postgree

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Client

Please complete the following information.

  • Browser (incl. version):
  • OS:

Log files

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.

@apg1980 apg1980 added bug Something isn't working need to reproduce Issue that has not been reproduced labels Mar 22, 2023
@theatischbein
Copy link
Contributor

theatischbein commented Mar 22, 2023

I can confirm it with Nextcloud 25 and Notes app 4.7.1 (debain 11, nginx, php 8.2, mysql)
I tested both rich text and editor mode

Edit: But I have to be fast enough, otherwise autosave triggers first

Suggestion:
It appears to be this section of code. Why not add an commit call here instead of warning the user ?

notes/src/App.vue

Lines 339 to 343 in 6dca9d7

onClose(event) {
if (!this.notes.every(note => !note.unsaved)) {
event.preventDefault()
return this.t('notes', 'There are unsaved notes. Leaving the page will discard all changes!')
}

@juliushaertl
Copy link
Member

This is a browser limitation as it is not guaranteed that any requests performed during the before unload event are handled. This event is explicitly only for asking for confirmation. As far as I'm aware there is no way we can ensure that the file would be saved before navigating away except blocking with this dialog.

@apg1980
Copy link
Author

apg1980 commented Mar 23, 2023

why did it worked on nc25?

@apg1980
Copy link
Author

apg1980 commented Mar 23, 2023

furthermore if i just stay on an note it appears while changing the nc site

@theatischbein
Copy link
Contributor

theatischbein commented Mar 23, 2023

why did it worked on nc25?

What do you mean with "it worked" ?

For me (on nc25 and nc26) it behaves as followed:

  • If I edit a note wait for some seconds and then change to another app the note is saved and no warning appears
  • If I edit a note and try to click fast enough on another app the warning appears

In other words (like the code in my comment showed #987 (comment) ):
If you leave the app faster than the background asyncronous saving of the note is finished the warning appears to prevent data loss.
The latency of automatically saving a note should depend on the servers performance and you network connectivity, If I am not mislead.

@apg1980
Copy link
Author

apg1980 commented Mar 24, 2023

i did never get an popup on latest nc25 with the latest notes app on realease date of nc26 before upgrading to nc26. this behaviour is new, the environment (server nginx etc did not changed)

@juliushaertl
Copy link
Member

Do you use the plain markdown or the rich editing view? For the plain markdown the logic shouldn't have changed at all from 25.

@apg1980
Copy link
Author

apg1980 commented Mar 31, 2023

same behaviour on both methods.
next thin i can see, notes are not getting saved as expected before.
you can see the star beneth the note, latest changes are not saved after minutes.
i lost some important notes today, after leaving the typed notes.

@florianwgnr
Copy link

florianwgnr commented Mar 31, 2023

Relates to #1008 with NC 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants