This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e4d4709a-aa88-45ae-b203-0416a4f26793 XWIKI-24843 Open

The realtime editing toolbar and modals are rendered in view mode, including for guests

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-c4a1df66-82e1-4ad7-b72f-6cc434edee32 Manuel Leduc created this issue on 09/Sep/26 12:15
 
Summary: The realtime editing toolbar and modals are rendered in view mode, including for guests
Issue Type: cid:jira-generated-image-avatar-e4d4709a-aa88-45ae-b203-0416a4f26793 Improvement
Affects Versions: 13.9-rc-1
Assignee: Unassigned
Components: Realtime
Created: 09/Sep/26 12:15
Priority: cid:jira-generated-image-static-major-d5a9cda1-8630-4e89-91e3-8f3d3eeffbbc Major
Reporter: Manuel Leduc
Description:

Reproduction steps

  1. Log out, so as to browse as guest
  2. Visit http://localhost:8080/xwiki/bin/view/Sandbox/
  3. Look at the HTML source of the page

Expected

No realtime editing markup is present, since a guest cannot edit the page and we are not in an edit mode anyway.

Actual

About 8.5 KB of markup that is only useful while editing is emitted on every page view, for every user including guests:

  • the templates realtime-edit-toolbar, realtime-user, realtime-spinner, realtime-status, realtime-version and realtime-warning
  • three complete modals: realtime-changeSummaryModal, realtime-version-modal and realtime-leave-modal
  • an inline JSON configuration containing the Netflux WebSocket URL and the current user's name and avatar URL

Rendering it also costs a #getUserAvatarURL(...) call and a $services.websocket.url('netflux') call per page view.

In addition, /bin/ssx/XWiki/Realtime/Configuration is linked three times in the same page.

Analysis

Everything comes from a single UI extension in XWiki/Realtime/Configuration.xml, registered on org.xwiki.platform.template.header.after with scope=wiki, which flamingo/global.vm renders for every action. The extension content has no check on $xcontext.action, no hasAccess('edit') check and no guest check — the only conditionals it contains trim individual buttons.

For comparison, the in-place editing UI extension uses the same extension point but does guard itself with $xcontext.action == 'view' and $hasEdit, so the mechanism to do this is already available and in use elsewhere.

About the three SSX links: two of them are deliberate, because toolbar.js clones the realtime-spinner and realtime-status templates into shadow roots and the stylesheet has to be imported inside each shadow root. The third one is the regular skin extension link in the <head>, emitted because $xwiki.ssx.use() also registers the extension in the per-request list. Only that third one is redundant.

Suggested fix

Guard the UI extension so that it only renders for the actions where realtime editing can actually start. For the two shadow DOM copies, reference the stylesheet directly instead of re-emitting the skin extension import, so that it is not also added to the page <head>.

 
 

1 update

 
cid:jira-generated-image-avatar-c4a1df66-82e1-4ad7-b72f-6cc434edee32 Changes by Manuel Leduc on 09/Sep/26 12:18
 
Labels: performance