Skip to content

[stable35] fix(federation): do not use the underscore global on the remote page - #6213

Merged
juliusknorr merged 1 commit into
nextcloud:stable35from
Rikdekker:fix/stable35-underscore-global
Oct 20, 2026
Merged

juliusknorr merged 1 commit into
nextcloud:stable35from
Rikdekker:fix/stable35-underscore-global

Conversation

@Rikdekker

Copy link
Copy Markdown
Contributor

Summary

Server 35 removed the deprecated underscore global (nextcloud/server@bfd6f754a). src/document.js on stable35 still calls _.bind(documentsMain.onClose), so on a Nextcloud 35 instance the remote page for federated files throws _ is not defined before the editor loads. Because of that, #6210 alone does not fix federated documents when the instance that owns the file runs 35.

The binding did nothing, since onClose only refers to documentsMain, so this passes the function directly. On main the same line was already changed in f5b7820, which is why the matching commit dropped out of #6190 when it was rebased. It is the only use of a removed global (_, moment, ClipboardJS, dav) in src on stable35.

stable34 and older do not need this: server 34 still provides the global, with a deprecation warning.

How I tested

Server 35.0.2 (the scripts/dev-server.mjs from main, run with BRANCH=stable35) acting as two instances through two origins, the same setup as in #6190: the owner on http://127.0.0.1:8081, the recipient on http://localhost:8081, with a federated share between them. A Playwright script opens the shared document as the recipient and closes it from Collabora.

stable35 (12.0.1) with this fix
Remote page _ is not defined, editor never loads editor loads
Viewer closes after "Close document" n/a yes
URL after closing n/a …?dir=/

A local, non-federated document still opens and closes. Lint and the build pass.

I also ran it between two separate servers: the owner on Nextcloud 35.0.0 with stable35 (#6210 included), the recipient on Nextcloud 33.0.1 with richdocuments 10.3.0, each with its own domain and both using the same Collabora. Without this commit the remote page on the owner throws _ is not defined and the editor never loads. With it the document opens, and closing it closes the viewer on the recipient. For the editor to load in that setup, the owner's Collabora has to allow the recipient as a frame ancestor (net.frame_ancestors), because the recipient's page sits above the remote page.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

🤖 Generated with Claude Code

Server 35 no longer provides `_` (nextcloud/server@bfd6f754a), so the
remote page for federated files throws `_ is not defined` before the
editor loads. The binding did nothing: onClose only refers to
documentsMain. main dropped it in f5b7820.

Signed-off-by: Rikdekker <Rikdekker@users.noreply.github.com>
Assisted-by: ClaudeCode:claude-opus-5-5
@juliusknorr
juliusknorr merged commit 6f8926a into nextcloud:stable35 Oct 20, 2026
38 checks passed
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.

2 participants