Repository navigation
[stable35] fix(federation): do not use the underscore global on the remote page - #6213
Merged
juliusknorr merged 1 commit intoOct 20, 2026
Merged
Conversation
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
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Server 35 removed the deprecated underscore global (nextcloud/server@bfd6f754a).
src/document.json stable35 still calls_.bind(documentsMain.onClose), so on a Nextcloud 35 instance the remote page for federated files throws_ is not definedbefore 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
onCloseonly refers todocumentsMain, 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) insrcon 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.mjsfrom main, run withBRANCH=stable35) acting as two instances through two origins, the same setup as in #6190: the owner onhttp://127.0.0.1:8081, the recipient onhttp://localhost:8081, with a federated share between them. A Playwright script opens the shared document as the recipient and closes it from Collabora._ is not defined, editor never loads…?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 definedand 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
🤖 Generated with Claude Code