There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-3bdd7ba2-d70d-4338-b769-c55109e30cc6 XWIKI-24800 Closed

The WYSIWYG editor sometimes doesn't join the realtime collaboration session

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-fa22eb4a-456a-421d-bed3-75ff70a09029 Simon Urli on 15/Oct/26 09:45
 

This bug also affects the 17.10.x branch, but the fix was only applied to stable-18.4.x and master.

RealtimeWYSIWYGEditorIT#syntaxChange failed on stable-17.10.x in https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-17.10.x/320/ (commit 87df7079518, PostgreSQL latest / Tomcat 11-jdk25 / S3 / Chrome). It fails on the check made right after the syntax change recreates the editor:

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.xwiki.realtime.wysiwyg.test.ui.RealtimeWYSIWYGEditorIT.syntaxChange(RealtimeWYSIWYGEditorIT.java:2247)

i.e. assertTrue(firstEditPage.getToolbar().isCollaborating()): the recreated editor didn't join the realtime session, which is the symptom described here (and the cause of XWIKI-24287).

The racy guard is on stable-17.10.x: XWIKI-23985 was fixed in 17.10.4, and xwiki-realtime/plugin.js on stable-17.10.x still has, in editor._realtime.connect:

if (editor.mode !== 'wysiwyg') {
  // Realtime collaboration is supported, but we can't join until the user switches to WYSIWYG mode.
  return true;
}

with no wait for the editing mode to be set, so it also matches "the mode isn't set yet". The whenEditingModeIsSet() fix from https://github.com/xwiki/xwiki-platform/pull/6301 isn't there.

It's intermittent: 1 failure in the last 10 builds/environments, and 3/3 passed when run locally on the same commit with the same configuration. It's a product bug, though, not just a test flicker: users of 17.10.x can silently end up editing outside the realtime session.

So 17.10.4 should be added to the Affects Version/s, and the fix backported to stable-17.10.x (the 17.10.x plugin.js is structured differently, so the backport needs adapting rather than a plain cherry-pick).