Skip to content

Peer protocol compatibility check between jack instances #8

@roziscoding

Description

@roziscoding

Context

Dropping Jellyfin and sourcing from Radarr/Sonarr (#7) changed the /peer payload contract even though the routes (/peer/search, /peer/items/:id, /peer/items/:id/file) and X-Api-Key auth are unchanged:

  • items are now Release objects (id, title, filename, category, size, imdbId/tmdbId/tvdbId, quality, …) instead of Jellyfin BaseItemDto (Id, Name, Type, ProviderIds, MediaSources).
  • the item id is now ${connectorId}:${kind}:${fileId} instead of a Jellyfin GUID.

This is a breaking, silent incompatibility between versions:

  • new jack → old peer: PeerConnector validates the response against the Release zod schema, so an old peer's BaseItemDto payload makes the fetch throw → no results.
  • old jack → new peer: the old client discards Release items (no Type/Name/MediaSources) and the id won't resolve for download.

Today the only signal is "empty results" / a fetch error in logs — there's no clear "this peer is incompatible" message.

Ask

Add an explicit compatibility/version check between peers so mismatches are detected and surfaced clearly instead of failing silently. Options to consider:

  • Expose a protocol version from /peer (e.g. a /peer/info handshake or a header on /peer/search), and have PeerConnector.init() read it and refuse/warn on mismatch with a clear log line (peer "<name>" runs an incompatible peer-protocol version: expected vX, got vY).
  • Optionally version the /peer API path or content so future changes can negotiate.
  • Surface incompatible peers in /servers output.

Notes

For now the network upgrades in lockstep (all peers move to the new version together); this issue is to make future protocol changes safe and self-diagnosing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions