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

[stable27] Refactor document and session handling #5543

Merged
merged 19 commits into from
Apr 3, 2024

Commits on Apr 2, 2024

  1. fix(backend): Reset document session and yjs file when file is deleted

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    98d01d5 View commit details
    Browse the repository at this point in the history
  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.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    f00de1e View commit details
    Browse the repository at this point in the history
  3. fix(backend): Remove yjs file and all steps when resetting document s…

    …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- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    10938f4 View commit details
    Browse the repository at this point in the history
  4. fix: catch expected exception in event handler

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    9a98ec2 View commit details
    Browse the repository at this point in the history
  5. fix: Clean up logic to return document state file or file content

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    da4bf9c View commit details
    Browse the repository at this point in the history
  6. fix: Set base version etag to a unique id per document creation

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    d7c173d View commit details
    Browse the repository at this point in the history
  7. fix(sync): If baseVersionEtag changed, reset frontend

    `baseVersionEtag` changes when a new document session got initialized,
    e.g. after an old document session without session clients got cleaned
    up, or because the markdown file got changed via webdav.
    
    Detect this in the client and ask the user to reload the page for
    resetting the session.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    c26cb39 View commit details
    Browse the repository at this point in the history
  8. fix(Middleware): Response with 412 if baseVersionEtag doesn't match

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    3978f12 View commit details
    Browse the repository at this point in the history
  9. fix(DocumentStatus): Refactor and migrate to NcNoteCard

    Fixes: #4905
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    a9c3b69 View commit details
    Browse the repository at this point in the history
  10. test(cypress): Add session API tests with non-matching baseVersionEtag

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    5c3fe47 View commit details
    Browse the repository at this point in the history
  11. text(cypress): Test browser refresh warning after document session cl…

    …eanup
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    cfa9ec8 View commit details
    Browse the repository at this point in the history
  12. fix(response): Make sure JSONResponse returns valid data

    Wrap error messages into an array when responding with `JSONResponse`.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    4a08af8 View commit details
    Browse the repository at this point in the history
  13. fix: Create idempotent y.js doc for initial content

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    cdc310f View commit details
    Browse the repository at this point in the history
  14. tests: Add tests for loading documents from different preconditions

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    1a46a1b View commit details
    Browse the repository at this point in the history
  15. fix: Always return initial content when needed

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    5f8484f View commit details
    Browse the repository at this point in the history
  16. tests: Adjust tests covering initial state

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    16c9afd View commit details
    Browse the repository at this point in the history
  17. ci: Make cypress test more stable by closing connections

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    fbfba86 View commit details
    Browse the repository at this point in the history
  18. fix: Adapt to review feedback

    Signed-off-by: Julius Härtl <jus@bitgrid.net>
    juliusknorr authored and mejo- committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    4dabf75 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. chore(assets): Recompile assets

    Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
    nextcloud-command committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    88f49a5 View commit details
    Browse the repository at this point in the history