Repository navigation
Fix buffering events in JointJS async context - #1810
Merged
Merged
Conversation
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
This PR fixes an issue when the JointJS paper is rendered in async mode. In async mode, the view is not available until it's completely rendered. Therefore, we need to buffer some UI events until we know it's completely rendered. We created a function `bufferWhileAsync` to do this. The old `bufferWhileAsync` implementation has problems: for each input event, multiple duplicate output events (3 events) are emitted. This PR rewrites the implementation to make it correctly produce a single output event.
This was referenced Sep 26, 2026
renovate-bot
pushed a commit
to renovate-bot/apache-_-texera
that referenced
this pull request
Sep 27, 2026
…e#8695) ### What changes were proposed in this PR? Deletes `ObservableContextManager` and re-parents its only subclass, `JointGraphContext`, onto `ContextManager`. **+8/−223 lines.** There is no behaviour change: the removed layer only emitted enter/exit events on Subjects nothing subscribes to, and `JointGraphContext`'s own `enter` / `exit` overrides still call `super`. ### History | | | | --- | --- | | **Introduced by** | apache#1433 (2022-02-07), "Bugfix for Albert load workflow opt". `JointGraphContext` used the change stream to buffer JointJS events in async mode | | **Usage removed by** | apache#1810 (2023-01-27), "Fix buffering events in JointJS async context". It deleted both `getChangeContextStream()` subscribers | It has been dead for over three and a half years. Every paper-context enter/exit since then has emitted into streams with no reader. > Reviewer note: `context.spec.ts` goes from 23 cases to 12. The 11 stream-only cases are deleted. 4 others move into `describe("ContextManager")` with their stream assertions dropped, because they cover `ContextManager` paths the original 8 cases did not: object-identity contexts, nested unwinding when a callable throws, falsy return values, and re-entering the same value. ### Any related issues, documentation, discussions? Closes apache#8694 ### How was this PR tested? No new tests. The kept `ContextManager` cases cover the surviving code. From `frontend/`: - `npx ng test --watch=false --include='**/context.spec.ts' --include='**/joint-graph-wrapper.spec.ts' --include='**/workflow-editor.component.spec.ts'`: 3 files, 199 tests, all pass. - `yarn format:ci`: clean. - `npx ng build`: success. To re-check: ``` git grep -n "ObservableContextManager\|getChangeContextStream\|getEnterStream\|getExitStream" -- frontend # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue when the JointJS paper is rendered in async mode.
In async mode, the view is not available until it's completely rendered. Therefore, we need to buffer some UI events until we know it's completely rendered. We created a function
bufferWhileAsyncto do this.The old
bufferWhileAsyncimplementation has problems: for each input event, multiple duplicate output events (3 events) are emitted. This PR rewrites the implementation to make it correctly produce a single output event.