Repository navigation
fix(trs): reset tool class filter on switch - #587
Conversation
Clear the tool class filter, the tool classes and their map of ecc-client-ga4gh-trs-tools when its provider or base URL changes, so the first request to the new provider is not filtered by a class of the previous one and the select offers no old classes. Bind the select value to the filter so it shows all classes after the reset. Closes #586 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bind the tool class select with live() so a reset always reaches it, test the reset for base URL switches and for a class picked while a load is still running, link the providers page to the tools page and describe what the select shows after a reset in the changeset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationReset the tool-class filter and clear the previous provider’s tool-class data when the provider or base URL changes, so the new provider’s request starts unfiltered.
UIBind the tool-class select to the filter value so it displays the reset state after a provider switch.
ConfigurationRecord the TRS package patch release and summarize the provider-switch behavior in its changeset.
DocumentationDocument how the TRS tools list resets its filter and available classes on provider or base URL switches.
Link the providers overview to the TRS tools documentation for provider-switch behavior.
TestsAdd regression coverage for provider and base URL switches, including stale class options, selections made during a pending load, and the select’s reset value.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Documentation build overview
53 files changed ·
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #587 +/- ##
==========================================
+ Coverage 76.96% 77.02% +0.05%
==========================================
Files 73 73
Lines 18783 18787 +4
Branches 1175 1178 +3
==========================================
+ Hits 14457 14471 +14
+ Misses 4305 4295 -10
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 7f2ebcd #586 fix(trs): drop old tool class filter on provider switch · 7 of 7 met
|
anuragxxd
left a comment
There was a problem hiding this comment.
Thanks Alex, looks good: small change, and the tests cover the switch while a load is still running. LGTM.
Resolve the conflict in the TRS tools list tests by keeping both sides: the timeout test of this branch and the tool class filter tests of #587. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #586
Summary
On a provider or
baseUrlswitch,ecc-client-ga4gh-trs-toolsnow resets the tool class filter and clears the previous provider's tool classes before it loads from the new provider (option 1 from the issue: reset to all classes):filterParams.toolClassis reset to"", so the first request to the new provider has no tool class filter.toolClassesandtoolClassMapare cleared, so the select offers no classes of the previous provider while the new ones load (a late result from the old provider was already dropped as stale).live()), so after the reset the select shows its placeholder and not the old class.@elixir-cloud/trspatch.Verification
packages/ecc-client-ga4gh-trs/src/components/tools/tests/tools.test.ts(filter dropped on a provider switch; no old classes while a slowgetToolClasses()of the new provider loads) failed before the fix (expected 'Notebook' to equal '',expected [ Array(1) ] to deeply equal []) and pass with it. Further tests cover abaseUrlswitch and a class picked while a load is still running.npx web-test-runner "src/**/*.test.ts" --config ../../web-test.runner-config.mjs --port 8005inpackages/ecc-client-ga4gh-trs: 92 passed in Chromium and Firefox. WebKit isn't installed locally, so CI covers it.npm run lint(turbo; includes the build of all packages and the docs site): passes. The only warnings in the touched files are two oldno-consolewarnings.npx turbo run build --filter=@elixir-cloud/trs: passes.CI passed).Declined review findings
drops a tool class filter picked during a load on a provider switch) passes even withoutlive(): the switch's own render commits the picked value beforeupdated()resets it, so the reset is always written.live()is kept anyway as a cheap safeguard, together with the test.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Reset tool-class filtering when the TRS tools data source changes so requests and selections do not carry over classes from the previous provider.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: