Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Albert load workflow opt #1481

Closed
wants to merge 34 commits into from

Conversation

MysteriousChallenger
Copy link
Collaborator

Bug: operator links disappear when using version switching feature

Cause:

Jointjs attempts to sort DOM elements using z attributes saved in it's internal model.
However, during async mode, the visible DOM is out of sync with the internal model.
Thus, jointjs sometimes cannot find the elements that exist in the DOM (they have been deleted, for example)

Solution:

disable sorting during async mode

MysteriousChallenger and others added 30 commits January 20, 2022 22:38
...by freezing joint paper until all updates are complete,
skipping unnecesarry rendering
...by batching the addition of new operators
with one addcells() / resetcells() call
ContextManager with RXJS event streams
it now buffers input while the joint graph wrapper
is in an async context
accidentally made SyncTexeraGraph listeners asynchronous via
createContextAwareStream(jointCellAddStream) .

This caused them to not be disabled by
this.setSyncTexeraGraph(false);
which is commonly used internally to temporarily
sidestep synchronization .

I've applied the context awareness more specifically to
handleLinkBreakpointToolAttachment(), where it's specifically needed.
as an RXJS pipeable operator named bufferWhileAsync.
Also moved it inside JointGraphContext
set to protected funcs. Use withContext instead
use "this" instead of classname. allows for method overriding
highlight/unhighlight operations fail unless
buffered until the end of joint-graph async context,

It is no longer guaranteed that the unhighlight event will be recieved
before the element is deleted due to buffering of events.
(although such guarantees were never documented)
... if reloadworkflow is called without using async context.
This was due to addCells being intrinsically an asynchronous operation
that buffers changes to the actual dom
Fix was to wrap all addCells contexts in their own async context.
This shouldn't harm reload performance, since the workflow is only
reloaded when context changes from async to synchronous
technical insights written down explaining how the
joint graph wrapper's async/sync context system works.

It's usage should be self explanatory though
zuozhiw and others added 3 commits March 9, 2022 17:36
Cause: jointjs refers to DOM when sorting elements by z attribute,
However, during async mode, DOM is out of sync with jointjs's internal representation
Solution: turn off sorting during async mode
@MysteriousChallenger MysteriousChallenger deleted the albert-load_workflow_opt branch March 15, 2022 06:10
@MysteriousChallenger
Copy link
Collaborator Author

Superseded by #1482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants