Skip to content

fix(collaboration): match WOPI app extensions without case - #3569

Merged
aduffeck merged 1 commit into
opencloud-eu:mainfrom
NickWalters:fix/collaboration-extension-case
Sep 21, 2026
Merged

aduffeck merged 1 commit into
opencloud-eu:mainfrom
NickWalters:fix/collaboration-extension-case

Conversation

@NickWalters

Copy link
Copy Markdown
Contributor

Description

The WOPI discovery response lists its extensions in lower case, and parseWopiDiscovery stores them as the app published them. OpenInApp then looks up path.Ext() of the real file name against those keys, which is an exact match. So report.DOCX finds no app url while report.docx opens, and the web UI says it cannot contact the application, which reads like the editor is down.

Both ends now fold the case: the parser lowercases the ext before it becomes a map key, and GetAppURLFor lowercases the extension it is given. Either one alone would leave the other side broken if an app ever published an upper case ext.

The log line and the returned error also name the extension. Neither said which file type had no app, which is the second half of the issue.

Behaviour worth knowing: if a discovery response declared the same extension twice in different cases, the last one in document order now wins instead of both being kept. No app does that today, and both entries would point at the same action.

Related Issue

Motivation and Context

Files arrive with whatever case the client gave them. A .DOCX from a Windows share or an old export is a normal thing to find in a space, and there is no reason for it to open differently from a .docx. The generic error made it look like an outage of the office app, so the cause was hard to find.

How Has This Been Tested?

  • test environment: go test ./services/collaboration/..., all packages pass
  • test case 1: GetAppURLFor with .DOCX and .DocX against stored lower case keys, for both the view and the edit action
  • test case 2: a discovery response with ext="ODT", which has to come back as .odt
  • both specs fail without the change (2 failed, 16 passed) and pass with it
  • go vet ./services/collaboration/... is clean

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

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

The WOPI discovery response lists its extensions in lower case, and
OpenInApp looks them up with the extension of the file as it is on disk.
So a "report.DOCX" found no app url while a "report.docx" opened, and
the web UI reported that it could not contact the application, which
reads like the editor is down.

The extensions now go into the map in lower case and the lookup folds
the case as well, so both ends match whatever the app publishes. The log
line and the error also name the extension, because neither said which
file type had no app.

Fixes opencloud-eu#3449
@codacy-production

codacy-production Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f293031) 88741 21470 24.19%
Head commit (bbebdf9) 88743 (+2) 21472 (+2) 24.20% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3569) 5 5 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@aduffeck aduffeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you :)

@aduffeck
aduffeck merged commit 4e73607 into opencloud-eu:main Sep 21, 2026
67 checks passed
@NickWalters

Copy link
Copy Markdown
Contributor Author

@NickWalters
NickWalters deleted the fix/collaboration-extension-case branch September 22, 2026 04:41
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.

OpenInApp file-extension lookup is case-sensitive; UI error hides the cause

2 participants