Skip to content

refactor(frontend): remove the unused ObservableContextManager - #8695

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-observable-context-manager
Sep 27, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-observable-context-manager

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

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 #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 #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 #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

Nothing has subscribed to its enter/exit/change streams since apache#1810
replaced the JointJS event buffering that read them. Re-parent
JointGraphContext onto ContextManager and delete the observable layer;
four ContextManager-relevant spec cases move into the ContextManager
block with their stream assertions dropped.
Copilot AI lite review requested due to automatic review settings September 26, 2026 23:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @eugenegujing, @yangzhang75
    You can notify them by mentioning @eugenegujing, @yangzhang75 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.71%. Comparing base (33bd07b) to head (595fd07).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8695      +/-   ##
============================================
- Coverage     92.72%   92.71%   -0.01%     
  Complexity     4947     4947              
============================================
  Files          1243     1243              
  Lines         52682    52657      -25     
  Branches       6520     6519       -1     
============================================
- Hits          48850    48823      -27     
  Misses         2214     2214              
- Partials       1618     1620       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from 33bd07b
agent-service 99.16% <ø> (ø) Carriedforward from 33bd07b
amber 88.45% <ø> (ø) Carriedforward from 33bd07b
computing-unit-managing-service 60.41% <ø> (ø) Carriedforward from 33bd07b
config-service 87.37% <ø> (ø) Carriedforward from 33bd07b
file-service 81.53% <ø> (ø) Carriedforward from 33bd07b
frontend 96.52% <100.00%> (-0.02%) ⬇️
notebook-migration-service 83.73% <ø> (ø) Carriedforward from 33bd07b
pyamber 98.56% <ø> (ø) Carriedforward from 33bd07b
workflow-compiling-service 74.09% <ø> (ø) Carriedforward from 33bd07b

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The unused abstraction is removed, core behavior coverage is retained, and no unresolved issues were identified.

Review effort: Lite
Findings: None

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Sep 27, 2026
Merged via the queue into apache:main with commit fcaf27a Sep 27, 2026
27 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/fe-observable-context-manager branch September 27, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the unused ObservableContextManager

4 participants