Skip to content

Migrate updates-api.ts from raw fetch to the typed client #85

Description

@bburda

Summary

lib/updates-api.ts calls the gateway software-update endpoints with raw fetch() instead of the generated @selfpatch/ros2-medkit-client-ts client used everywhere else in the app. Now that the 0.6.0 client types the updates operations, migrate this module to the typed client for consistency.

Proposed solution

Replace the raw fetch() calls in updates-api.ts (fetchUpdateIds, fetchUpdateStatus, fetchUpdateDetail, and the prepare / execute / automate / delete helpers) with the typed client's updates operations.

Preserve the existing behavior:

  • the status-code-aware UpdatesApiError that distinguishes 501 ("no update backend") from other errors (the typed client exposes the response status, so this is achievable);
  • the opaque, plugin-defined update detail response.

Additional context

  • This is not a 0.5.0 migration workaround (there is no "temporary" / "until regenerated" marker) - it is a deliberate hand-written module, so this is a consistency / maintainability refactor, not a bug.
  • The direct 0.5.0 query-param suppressions (/logs, /faults) were already removed during the 0.6.0 client migration; this module is the remaining raw-fetch path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions