Skip to content

[stable31] fix(viewer): register handlers not yet in the lookup table when openi… - #3418

Merged
skjnldsv merged 2 commits into
stable31from
fix/registered-handlers-lookup
Oct 6, 2026
Merged

skjnldsv merged 2 commits into
stable31from
fix/registered-handlers-lookup

Conversation

@silverkszlo

Copy link
Copy Markdown

The bug

On a single-file share, the Files app opens the file as soon as its file list request (PROPFIND) returns. The Viewer only builds its handler lookup table on DOMContentLoaded. If a slow script holds back DOMContentLoaded, the file is opened while that table is still empty, and you get the error: "There is no plugin available to display this file type".

The fix

A new registerNewHandlers() method adds any handlers that are not in the lookup table yet. It now runs when a file is opened, as well as on DOMContentLoaded. Handlers are never added twice, and ones registered later are still picked up.

The test

It holds back DOMContentLoaded on a single-file share by adding a fake script that Cypress answers after 3 seconds. It then checks that the shared image opens with no "no plugin" error. It fails without the fix and passes with it, so it reproduces the race on every run and shows the fix closes it.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

…ng a file

On single-file public shares, the files app can open the file before
DOMContentLoaded, while the component's handler lookup table is still
empty. This shows "There is no plugin available to display this file
type". Register any missing handlers when a file is opened, as well as
on DOMContentLoaded.

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by:ClaudeCode:claude-opus-5.5
@silverkszlo silverkszlo changed the title fix(viewer): register handlers not yet in the lookup table when openi… [stable31] fix(viewer): register handlers not yet in the lookup table when openi… Oct 5, 2026
@silverkszlo

Copy link
Copy Markdown
Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>

@blizzz blizzz 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.

tested successfully

@blizzz
blizzz requested review from a team, kristian-zendato, skjnldsv and sorbaugh and removed request for a team October 5, 2026 17:44
@blizzz blizzz added bug Something isn't working 3. to review Waiting for reviews labels Oct 5, 2026
@skjnldsv

skjnldsv commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Probably good to have for stable3[2-5] ?
And pairing ith #3419

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

Labels

3. to review Waiting for reviews bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants