Skip to content

refactor(frontend): remove the unused dictionaryChangedSubject - #8817

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-user-config-dictionary-subject
Oct 2, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/fe-user-config-dictionary-subject

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Removes dictionaryChangedSubject from UserConfigService: the private field, its three .next() calls in updateEntry / updateDict, and the now-unused rxjs Subject import. +8/−49 lines. There is no behaviour change. The Subject was private with no getter, so nothing could subscribe to it.

updateEntry and updateDict keep their guards, deletes and assignments; only the emissions go. In the spec, two cases that only counted emissions are deleted. Two others are kept, with their emission assertions replaced by behaviour checks, because they cover the surviving guards: a repeated set() still issues a PUT and keeps the entry, and deleting an absent key leaves the dictionary untouched.

History

Introduced by #1162 (2021-06-27), "Add UserDictionaryService (User Presets Step 2)". The field was private from the start, with no getter or asObservable()
Usage removed by never used. The only readers were spec cases reaching the private field through (service as any)

It has been unused for over five years.

Any related issues, documentation, discussions?

Closes #8816

How was this PR tested?

No new tests. The two kept cases now pin the guards' behaviour instead of emission counts.

From frontend/:

  • npx ng test --watch=false --include='**/user-config.service.spec.ts' --include='**/preset.service.spec.ts': 2 files, 68 tests, all pass. PresetService is the only production consumer of UserConfigService.
  • yarn format:ci: clean.
  • npx ng build: success.

To re-check:

git grep -n -i "dictionaryChanged" -- 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

…ngedSubject

The Subject has been private with no getter since apache#1162 added it, so
nothing could ever subscribe. Drop the field, its three .next() calls in
updateEntry/updateDict, and the unused Subject import. Two spec cases that
only counted emissions go; two others now pin the surviving guards'
behaviour instead.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 05:06

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 Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

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

  • No candidates found from git blame history.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.58%. Comparing base (566efb8) to head (9329213).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8817      +/-   ##
============================================
- Coverage     92.58%   92.58%   -0.01%     
  Complexity     4981     4981              
============================================
  Files          1244     1244              
  Lines         52933    52929       -4     
  Branches       6550     6550              
============================================
- Hits          49009    49004       -5     
  Misses         2293     2293              
- Partials       1631     1632       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from 566efb8
agent-service 99.16% <ø> (ø) Carriedforward from 566efb8
amber 88.06% <ø> (ø) Carriedforward from 566efb8
computing-unit-managing-service 60.41% <ø> (ø) Carriedforward from 566efb8
config-service 87.37% <ø> (ø) Carriedforward from 566efb8
file-service 81.53% <ø> (ø) Carriedforward from 566efb8
frontend 96.55% <ø> (-0.01%) ⬇️
notebook-migration-service 83.73% <ø> (ø) Carriedforward from 566efb8
pyamber 98.56% <ø> (ø) Carriedforward from 566efb8
workflow-compiling-service 74.09% <ø> (ø) Carriedforward from 566efb8

*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.

@aglinxinyuan
aglinxinyuan requested review from kunwp1 and mengw15 October 2, 2026 07:06
@mengw15
mengw15 requested a balanced review from Copilot October 2, 2026 20: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 review overview

🟢 Approval recommended

The cleanup is complete, behavior-preserving, and adequately covered by existing tests.

Review effort: Balanced
Findings: None

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Oct 2, 2026
Merged via the queue into apache:main with commit 1fc75b1 Oct 2, 2026
27 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/fe-user-config-dictionary-subject branch October 2, 2026 21:06
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 16, 2026
…#9435)

### What changes were proposed in this PR?

Clean up dead methods and helpers that remain unused in the latest
upstream `main` and were only referenced by their own specs, as tracked
in apache#9195:

1. **`UserConfigService.getDict()`** in
`frontend/src/app/common/service/user/config/user-config.service.ts`:
   - Removed the unread dictionary getter.
- Refactored `user-config.service.spec.ts` to preserve complete
behavioral coverage across fetch, set, delete, login, and logout using
observable behavior and public interfaces (verifying that `delete()`
issues an HTTP DELETE request only when the target key is present in the
local cache).
2. **`GuiConfigService.source()`** in
`frontend/src/app/common/service/gui-config.service.ts`:
- Removed uncalled `source(name: ConfigSource)` which was superseded by
memoized configuration getters (`env`).
   - Removed corresponding unit tests in `gui-config.service.spec.ts`.
3. **`assert()`** in `frontend/src/app/common/util/assert.ts`:
- Removed uncalled `assert()` function (`asType` and `isType` type
guards remain).
   - Removed corresponding unit tests in `assert.spec.ts`.

*(Note: Per maintainer confirmation on apache#9195, `dictionaryChangedSubject`
landed earlier in apache#8817 and `localRemoveObject`/`sessionRemoveObject`
landed earlier in apache#9256; those completed changes are untouched.)*

### Any related issues, documentation, discussions?

Closes apache#9195

### How was this PR tested?

All changes were thoroughly tested locally via the repository-standard
test runner:

1. **Affected Spec Files:**
- `yarn ng test --watch=false
--include=src/app/common/util/assert.spec.ts` (6/6 passed)
- `yarn ng test --watch=false
--include=src/app/common/service/gui-config.service.spec.ts` (12/12
passed)
- `yarn ng test --watch=false
--include=src/app/common/service/user/config/user-config.service.spec.ts`
(20/20 passed)
2. **Dependent / Downstream Spec Files:**
- `yarn ng test --watch=false
--include=src/app/workspace/service/preset/preset.service.spec.ts`
(48/48 passed)
3. **Common Suite:**
- `yarn ng test --watch=false --include="src/app/common/**/*.spec.ts"`
(876/876 passed across 55 test files)
4. **Code Quality, Type-Checking, and Build:**
   - `yarn tsc --noEmit` (Passed with 0 errors)
- `yarn tsc -p src/tsconfig.app.json --noEmit && yarn tsc -p
src/tsconfig.spec.json --noEmit` (Passed with 0 errors)
   - `yarn format:ci` (Passed cleanly)
   - `yarn lint` (Passed with 0 errors)
   - `yarn build` (Production frontend build succeeded)
   - `git diff --check` (Clean)

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Antigravity IDE (Gemini 3.8 Flash)
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 dictionaryChangedSubject from UserConfigService

4 participants