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

Cleanup document table entries and y.js state file handling #5476

Closed
4 of 6 tasks
juliusknorr opened this issue Mar 13, 2024 · 3 comments
Closed
4 of 6 tasks

Cleanup document table entries and y.js state file handling #5476

juliusknorr opened this issue Mar 13, 2024 · 3 comments
Assignees
Labels

Comments

@juliusknorr
Copy link
Member

juliusknorr commented Mar 13, 2024

From our discussion:

Current state

close

  • delete session table entry
  • delete inactive sessions (without steps)
  • document is kept
  • yjs file is kept
  • steps are kept

cron cleanup

  • foreach document without sessions and unsaved changes

    • reset document
      • delete all steps
      • delete all sessions
      • delete document
      • keep y.js file
  • delete inactive sessions (without steps) -> can trigger document cleanup in the next cron run

  • sessions with steps and the document are kept

Goal: support both keeping and removing y.js file

  • do not drop document db entry, only if y.js file is also removed (Julius)
  • ensure reconnects can detect an underlying y.js file has been recreated
    • backend: write unique id on insert to oc_text_documents for the base_version_etag (Julius)
    • frontend: on reconnect compare client base_version_etag with server one, full editor restart if no match (Max)
  • drop y.js state only on external file writes if no sessions are active (Jonas)
    • this will ensure we don't have a conflict dialog
  • check node deletion event for cleanup (follow up)
@mejo-
Copy link
Member

mejo- commented Mar 18, 2024

Scenarios (to be complemented):

  • Session got removed in backend but document+yjs stayed (baseVersionEtag still the same) -> Frontend reconnect sufficient
  • Sessions and document+yjs got removed in backend: -> Frontend needs a full reset (page reload) to load new yjs state

@mejo-
Copy link
Member

mejo- commented Mar 20, 2024

stable28 backport: #5541

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

No branches or pull requests

3 participants