Repository navigation
refactor(frontend): remove the unused dictionaryChangedSubject - #8817
Merged
aglinxinyuan merged 1 commit intoOct 2, 2026
Merged
aglinxinyuan merged 1 commit into
aglinxinyuan merged 1 commit into
Conversation
…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.
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mengw15
approved these changes
Oct 2, 2026
Closed
1 task done
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)
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.
What changes were proposed in this PR?
Removes
dictionaryChangedSubjectfromUserConfigService: the private field, its three.next()calls inupdateEntry/updateDict, and the now-unused rxjsSubjectimport. +8/−49 lines. There is no behaviour change. The Subject was private with no getter, so nothing could subscribe to it.updateEntryandupdateDictkeep 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 repeatedset()still issues a PUT and keeps the entry, and deleting an absent key leaves the dictionary untouched.History
asObservable()(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.PresetServiceis the only production consumer ofUserConfigService.yarn format:ci: clean.npx ng build: success.To re-check:
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
🤖 Generated with Claude Code