Skip to content

[Enhancement] Pass refresh signal from registry refresh button to API (blocked by toolhive#5266) #2237

Description

@peppescg

Context

PR #2216 added a Refresh button to the Registry page (visible for custom registries) with a tooltip showing Source and Updated (the upstream last_updated timestamp). The button currently calls refetch() on the React Query hooks for GET /api/v1beta/registry/default and GET /api/v1beta/registry/default/servers.

Problem

The button is already in place, but for custom registries of type api / url the backend caches data in memory for 1 hour with no way for HTTP clients to bypass it. Clicking refresh fires the same GET requests again, the backend returns cached data, and last_updated does not change. The button works for local_path (file re-read every GET) but is effectively a no-op for api/url.

Tracked upstream: stacklok/toolhive#5266

What needs to change here

Once stacklok/toolhive#5266 lands, the refresh callback in renderer/src/routes/(registry)/-registry.route.tsx needs to pass the cache-bypass signal to the API. The exact shape depends on which option toolhive ships:

  • POST /api/v1beta/registry/{name}/refresh endpoint (option 1 in upstream issue) → call the new endpoint before the existing refetch()s.
  • ?refresh=true query param on the existing GETs → pass it through the generated client options.
  • Cache-Control: no-cache header → set on the request headers for the refresh path only.

In all cases the button itself does not change — only what the refresh callback in -registry.route.tsx (lines 82–86) does before/during the refetch.

Tasks

Acceptance criteria

  • Clicking Refresh for a custom registry of type api/url returns fresh data from upstream (verify by changing the upstream registry and confirming the tooltip's Updated moves forward after a click).
  • Existing behavior for local_path is preserved.
  • Upstream failure (502/504) is surfaced to the user, not silently swallowed.

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions