Skip to content

Let other apps change a file that is open in Text, as one more collaborator #9701

Backlog

Description

@StevLauz

Is your feature request related to a problem? Please describe.

Apps that store their data as Markdown files (for example a Kanban app keeping each card as a card.md with YAML front matter) need to change those files while a person may have them open in Text. Today the app either gets 423 Locked (Text's lock, even after #9674 while someone is typing) or, when no lock is held, its write makes Text reset the document session (DocumentContentUpdatedListener → resetDocument(force: true)), so the open editor reloads and may lose steps that were not yet saved.

Describe the solution you'd like

A server-side API (for instance an OCP interface or an event that apps can dispatch) to apply a change to a document that has an active session: Text turns the new content, or a patch, into a Yjs update and broadcasts it to the open editors like a change from another collaborator, then saves as usual. No lock refused, no reset, nothing lost, and everyone sees the change live.

Describe alternatives you've considered

  • Writing inside Text's lock scope (ILockManager::runInScope with Text's app lock): the write goes through, but the session is still reset.
  • Retrying until Text's lock is released (5 minutes after the last change with feat(locks): lock files only while they are being edited #9674): works, but the person editing does not see the change until then.

Additional context

Observed on Nextcloud 34.0.1 / Text 8.0.0 with files_lock, server-side encryption: with a Text session holding one unsaved step, another app's putContent() gets ManuallyLockedException; once Text's lock is released (as #9674 does after 5 minutes), the write goes through and the document is reset: the unsaved step and the session are deleted.

Related: #9628, #9674, #9673, #3571 (front matter editor).
Also asking: could #9673 and #9674 be backported to stable34?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions