major
minor
major
minor
When you run a test script (e.g., TestFormatOptions.script.xml) that uses a "Goto" to jump to the Model Editor, a log message appears stating that the page has been reloaded, and the Script Recorder freezes after the script has executed.
Cause
The GoTo to DemoTypes.A opens the Diagram tab in the Model Editor and selects DemoTypes.A in the diagram. To display the corresponding diagram, the client-side control tl:DiagramJSGraphControl is created. The control contains a `tl:ObjectScope`, which includes, among other things, the graph itself, and is kept in sync with its server-side counterpart. Two `tl:ScopeListener`s are registered for the client-side `tl:ObjectScope` in the Model Editor:
- A listener that renders the diagram using uml.js or diagram.js.
- A listener that sends changes to the client-side ObjectScope to the server (after 150 ms) to update the server-side ObjectScope and keep it in sync.
Currently, the listeners are first registered with the client-side ObjectScope. The ObjectScope is then updated so that it matches the state of the server-side ObjectScope. Afterward, the listeners are notified—that is, the diagram is rendered and the changes are sent to the server so that it can update its server-side ObjectScope. The latter action is pointless in the context of diagram creation. When creating the `tl:ObjectScope`, the listener that keeps the two scopes in sync should not be registered until the client-side scope has been initialized.
If the user executes a script that modifies the graph—and thereby the client-side scope—and then hides the diagram (e.g., by switching tabs), this generally results in the page reloading, since the command to update the server-side graph or tl:ObjectScope is not executed until after the chart is hidden, since the corresponding tl:CommandListener is no longer visible or in existence.
Test
RunTestFormatOptions.script.xml. The script recorder should not pause. In particular, the page should not reload.