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

Reset document session on filesystem change #5481

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Mar 13, 2024

Contributes to #5476

📝 Summary

  1. fix(backend): Reset document session and yjs file when file is deleted
  2. fix(backend): Reset document session when updated from outside editor
    When a text file is updated via other means than from the editor (e.g. when uploaded/synced via webdav) and there is no unsaved steps in the document session, reset the document session This will prevent conflict resolution dialogs in this case. Client frontends will have to reload the document afterwards though.
  3. fix(backend): Remove yjs file and all steps when resetting document session
    Instead of just deleting the newest steps, always remove all session data: document, sessions and steps from the database as well as the yjs (document state) file.
    Without the --force option, don't reset document sessions with unsaved steps.

🏁 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
  • Documentation is not required

@mejo- mejo- force-pushed the fix/reset_document_on_file_change branch 2 times, most recently from dcfc860 to 6260d0a Compare March 13, 2024 20:27
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, will give it a spin tomorrow

When a text file is updated via other means than from the editor (e.g.
when uploaded/synced via webdav) and there is no unsaved steps in the
document session, reset the document session  This will prevent conflict
resolution dialogs in this case. Client frontends will have to reload
the document afterwards though.

Signed-off-by: Jonas <jonas@freesources.org>
…ession

Instead of just deleting the newest steps, always remove all session
data: document, sessions and steps from the database as well as the yjs
(document state) file.

Without the `--force` option, don't reset document sessions with unsaved
steps.

Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- force-pushed the fix/reset_document_on_file_change branch from 7b29ea6 to eded54c Compare March 14, 2024 07:14
@mejo- mejo- merged commit 0b024ee into main Mar 14, 2024
61 checks passed
@mejo- mejo- deleted the fix/reset_document_on_file_change branch March 14, 2024 14:10
@mejo-
Copy link
Member Author

mejo- commented Mar 20, 2024

/backport to stable28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants