I’m currently writing a Confluence app which provides a plugin for the TinyMCE editor in Confluence. One task of the TinyMCE plugin is to insert text at the current cursor position, i. e. it manipulates the HTML structure of the document. I learned that this is problematic with respect to collaborative editing with Synchrony (for example, one has to deactivate Grammarly for this reason as described here https://confluence.atlassian.com/confkb/confluence-collaborative-editing-blocks-grammarly-extension-857066095.html).
In order to make this work, I found out that apparently you have to trigger two Synchrony-related JavaScript events directly before and after making the changes to the HTML structure of the edited Confluence page. My TinyMCE plugin now uses the following code when inserting text at the current cursor position:
AJS.trigger('synchrony.stop', {id: 'some-custom-plugin-identifier'})
// insert text into HTML structure ...
AJS.trigger('synchrony.start', {id: 'some-custom-plugin-identifier'})
Before I added these events to my JavaScript code, I experienced the effect that the Synchrony process could not be started when rebooting Confluence after having used my plugin. By that, Confluence became unusable. Only after deleting a specific Jar file (with a name similar to 0.3.1-release-confluence_6.1-e20fb944.jar
) in Confluence’s temp
directory or by deactivating my Confluence app, Synchrony could be started again.
So I have two questions regarding Synchrony:
-
Is this Jar file
0.3.1-release-confluence_6.1-e20fb944.jar
(which apparently contains the Synchrony server and will be started in a separate process) ordinarily deleted when Confluence is shut down? Is it an error when this file persists in thetemp
directory after shutting down Confluence? -
Is triggering the two events
synchrony.stop
andsynchrony.start
enough to make a TinyMCE plugin play along nicely with Synchrony or do I have to take additional measures to make it work properly?
Thanks for helping!