Skip to content

fix(trs): drop old tool class filter on provider switch #586

Open

Description

@uniqueg

Problem

When an app switches the provider (or baseUrl) of ecc-client-ga4gh-trs-tools, the list loads the tools of the new provider right away, but with the tool class filter of the old one:

  • updated() resets the page (currentPage = 1) and calls loadData() and loadToolClasses() in parallel;
  • loadData() sends filterParams.toolClass, the name of a tool class that the user picked from the previous provider's classes;
  • toolClasses and toolClassMap keep the previous provider's classes until getToolClasses() of the new provider answers, so the tool class select still offers (and shows as selected) the old classes.

The new provider's first page is then filtered by a class that it may not have (empty list, or the wrong tools), and the select shows options that the new provider doesn't offer, until the user changes the filter.

#577 fixed the same kind of problem in the TRS-Filer tool form (tool-create), which clears the old tool classes on a switch and keeps submit disabled until the selected class is among the loaded ones.

Proposed fix

In packages/ecc-client-ga4gh-trs/src/components/tools/tools.ts, on a provider switch (the useProvider() branch of updated()):

  1. Clear toolClasses and toolClassMap before loading, so the select doesn't offer the old classes.
  2. Either reset filterParams.toolClass to "" (all classes), or keep it only if the new provider's classes contain it: load the tool classes first and then the tools, and drop the filter if the class isn't offered.
  3. Fire ecc-tools-changed as today, with the tools of the unfiltered (or still valid) query.

The first option is simpler and matches "another provider starts on its first page"; the second keeps a filter that both registries share (e.g. Workflow).

Tests

  • Switch the provider while a tool class filter is set: the first request to the new provider has no tool class (or only one that the new provider offers), and the select shows no old classes while the new ones load.
  • A slow getToolClasses() of the new provider doesn't bring back the old classes.

Docs

Note in the TRS tools page (and the providers overview's paragraph on provider switches) that a switch resets the tool class filter.

Follow-up to #577 (note by @anuragxxd); related: #565.

Activity

  1. added and removed
    status: triageHas not been triaged by admin
    on Nov 16, 2026
  2. self-assigned this
    on Nov 16, 2026
  3. moved this from Backlog to In progress in ELIXIR On-Cloudon Nov 16, 2026
  4. moved this from In progress to In review in ELIXIR On-Cloudon Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions