Skip to content

fix: [OCISDEV-1809] open documents in Collabora for editing - #13697

Merged
LukasHirt merged 2 commits into
stable-8.2from
backport/collabora-edit-url-8.2
Dec 4, 2026
Merged

LukasHirt merged 2 commits into
stable-8.2from
backport/collabora-edit-url-8.2

Conversation

@LukasHirt

@LukasHirt LukasHirt commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #13695 to stable-8.2.

Description

The collaboration service always used the view URL from Collabora's discovery and ignored the requested view mode. That worked while Collabora listed only one action per file type. The service now prefers the edit URL for read/write mode with every WOPI app, as it already did for Microsoft and OnlyOffice. For Collabora it still falls back from view to edit to view_comment when a file type has only one action.

UserCanWrite / ReadOnly in CheckFileInfo were already set from the view mode, so this changes only which URL Collabora opens, not what the user is allowed to do.

Related Issue

Motivation and Context

Newer Collabora builds list both view and edit for the same file type, and the view URL forces read-only mode (cool.html?permission=readonly&). Because oCIS always picked view, documents opened read-only even for users who can edit them. This is visible on demo.owncloud.com, which uses Collabora's public demo server (Collabora Online 26.04.6.3 snapshot).

Discovery per version (odt/docx/xlsx):

Collabora Actions view URL Before After
CODE 24.04.9, 24.04.12, 25.04.7 edit only – edit edit
CODE 25.04.9, 26.04.1, 26.04.3, 26.04.6.2 view + edit cool.html? view (harmless) edit
Online 26.04.6.3 snapshot view + edit cool.html?permission=readonly& view, read-only edit

How Has This Been Tested?

  • Unit tests: new table for URL selection per view mode, covering Collabora with both actions, single-action discoveries, the view_comment fallback, and Microsoft/OnlyOffice read-only. The existing Collabora entries now expect the edit URL for read/write.
  • Ran the real discovery parser and getAppUrl against the discoveries of the Collabora versions in the table (local collabora/code containers and the public demo server):
    • Before: the snapshot returned the readonly URL in read/write mode.
    • After: read/write returns the edit URL, and read-only still returns the readonly URL.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised

Newer Collabora versions advertise both "view" and "edit" actions per
extension in their discovery, and the "view" url can force read-only
mode via permission=readonly. The collaboration service always preferred
the "view" url for Collabora, so documents opened read-only even when
read/write mode was requested. Prefer the "edit" url for read/write
mode for every WOPI app and keep the existing Collabora fallbacks for
single-action discoveries.

Signed-off-by: Lukas Hirt <info@hirt.cz>
(cherry picked from commit 9c58835)
Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt requested a review from a team as a code owner December 4, 2026 13:54
@LukasHirt LukasHirt self-assigned this Dec 4, 2026
@kw-security

kw-security commented Dec 4, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@LukasHirt
LukasHirt enabled auto-merge (squash) December 4, 2026 16:03
@LukasHirt
LukasHirt merged commit 49f25bd into stable-8.2 Dec 4, 2026
137 of 139 checks passed
@LukasHirt
LukasHirt deleted the backport/collabora-edit-url-8.2 branch December 4, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants