Skip to content

Bugfix load workflow opt - #1435

Merged
zuozhiw merged 32 commits into
masterfrom
albert-load_workflow_opt
Mar 11, 2022
Merged

zuozhiw merged 32 commits into
masterfrom
albert-load_workflow_opt

Conversation

@MysteriousChallenger

Copy link
Copy Markdown
Contributor

Continuation of #1433

Thanks @zuozhiw for fixing a breakpoint related bug. I don't actually know how to test that yet.

REFACTORS

  • createContextAwareStream --> custom RXJS pipeable operator named bufferWhileAsync: I.E source$.pipe(bufferWhileAsynce)
  • ContextManager enter/exit are now protected (from public).

BUGS

  • Bug: Anomalous rendering when changing workflows
    Fix: re-add request an updateView() after the async period (mistakenly removed)

  • Bug: Can't highlight element because it doesn't exist (yet)
    Fix: Buffer highlight events to run after the async period. Introduce more bugs

  • Bug: Can't unhighlight element because it doesn't exist (anymore) (due to previous "fix")
    WontFix: Update highlighed list but don't actually call unhighlight() (it's already deleted after all)

A unhighlight event is emitted when an element is deleted. Due to buffering, it will only be handled after the async period, after the element is deleted (This behavior can be changed if needed)
However, It was never a documented guarantee that an unhighlighted element would still exist at the time it's event is handled. I don't think this is a big loss, so from now on, it's explicitly NOT GUARANTEED

MysteriousChallenger and others added 20 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)
@Yicong-Huang Yicong-Huang changed the title Bugfix Albert load workflow opt Bugfix load workflow opt Feb 8, 2022
... 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 zuozhiw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have tested the implementation again and the bugs I found are gone

@zuozhiw
zuozhiw merged commit bbc2364 into master Mar 11, 2022
@zuozhiw
zuozhiw deleted the albert-load_workflow_opt branch March 11, 2022 16:56
@MysteriousChallenger
MysteriousChallenger restored the albert-load_workflow_opt branch March 15, 2022 05:15
@Yicong-Huang Yicong-Huang added frontend Changes related to the frontend GUI and removed gui labels Jul 6, 2025
@Yicong-Huang Yicong-Huang removed the bug label Oct 4, 2025
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
# Continuation of apache#1433

Thanks @zuozhiw for fixing a breakpoint related bug. I don't actually know how to test that yet.

### REFACTORS
- createContextAwareStream --> custom RXJS pipeable operator named bufferWhileAsync: I.E `source$.pipe(bufferWhileAsynce)` 
- ContextManager enter/exit are now protected (from public).

### BUGS

- Bug: Anomalous rendering when changing workflows
Fix: re-add request an updateView() after the async period (mistakenly removed)

- Bug: Can't highlight element because it doesn't exist (yet)
Fix: Buffer highlight events to run after the async period. Introduce more bugs

- Bug: Can't unhighlight element because it doesn't exist (anymore) (due to previous "fix")
WontFix: Update highlighed list but don't actually call unhighlight() (it's already deleted after all)
>   A unhighlight event is emitted when an element is deleted. Due to buffering, it will only be handled after the async period, after the element is deleted (This behavior can be changed if needed)
> However, It was never a documented guarantee that an unhighlighted element would still exist at the time it's event is handled. I don't think this is a big loss, so from now on, it's explicitly NOT GUARANTEED

Co-authored-by: zuozhiw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants