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

feat(session): Send save request via sendBeacon at beforeunload #6798

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Dec 18, 2024

📝 Summary

This will send a final save request on unsaved changes via the browsers native navigator.sendBeacon() function when navigating away from the website or the tab/browser is closed.

Fixes: #6606

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

This will send a final save request on unsaved changes via the browsers
native `navigator.sendBeacon()` function when navigating away from the
website or the tab/browser is closed.

Fixes: #6606

Signed-off-by: Jonas <[email protected]>
@mejo- mejo- added bug Something isn't working 3. to review labels Dec 18, 2024
@mejo- mejo- requested a review from juliusknorr December 18, 2024 13:38
@mejo- mejo- self-assigned this Dec 18, 2024
@mejo- mejo- requested a review from max-nextcloud as a code owner December 18, 2024 13:38
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 46.74%. Comparing base (8586891) to head (bd683d4).

Files with missing lines Patch % Lines
src/services/SessionApi.js 0.00% 13 Missing ⚠️
src/services/SyncService.js 0.00% 11 Missing ⚠️
src/components/Editor.vue 0.00% 9 Missing ⚠️
src/components/Editor/Status.vue 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6798      +/-   ##
==========================================
- Coverage   46.76%   46.74%   -0.03%     
==========================================
  Files         748      740       -8     
  Lines       34162    34177      +15     
  Branches     1242     1234       -8     
==========================================
  Hits        15976    15976              
- Misses      17564    17587      +23     
+ Partials      622      614       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@max-nextcloud max-nextcloud self-assigned this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

Block closing/navigating away with unsaved changes
2 participants