Skip to content

Collaborative file lock not released when closing editor WebView #17380

Description

@kitzberger

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

When opening an editable file (markdown, rich document) via the in-app WebView editor (TextEditorWebView / RichDocumentsEditorWebView), the server's editor app (Nextcloud Text, Collabora) sets a COLLABORATIVE lock on the file. When the user closes the editor (back button, swipe away, or JavaScript close() call), EditorWebView.closeView() and ExternalSiteWebView.onDestroy() only call getWebView().destroy() + finish() — no API call is made to tell the server that editing finished.

Steps to reproduce:

  1. Ensure server has files_locking and text (or richdocuments) apps installed
  2. Open a .md file that is not downloaded via the Android app
  3. Observe the COLLABORATIVE lock being set on the server
  4. Close the WebView editor (back button or via the close button)
  5. The lock persists on the server

Expected behaviour

When the editor WebView is closed, the app should signal the server to release the COLLABORATIVE lock.

Actual behaviour

The COLLABORATIVE lock remains on the server indefinitely (until server-side timeout), blocking other users from editing.

Android version

15

Device brand and model

Fairphone 5

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

34.0.1

Nextcloud server version

34.0.1

Using a reverse proxy?

No

Android logs

No response

Server error logs

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions