Skip to content

GET /api/v1/packages still absorbs a failed REGISTRY read into a 200 — the other half of #11063's two-source merge #11130

Description

@os-elon

Found while implementing #11063 (the durable half). Not fixed there — different producer, and the #11063 grading authorized only the durable read. Filed unassigned for triage.

The defect

packages/rest/src/package-routes.ts, the GET /api/v1/packages handler, merges two sources into one listing:

  1. the in-memory registry, read through options.protocol.getMetaItems({ type: 'package' })
  2. the durable sys_packages rows, read through packageService.list()

#11063 removed the swallowing catch around source 2. Source 1 still carries its own:

if(options.protocol&&typeofoptions.protocol.getMetaItems==='function'){try{constresult=awaitoptions.protocol.getMetaItems({type: 'package'});// …merge result.items into packagesMap…}catch{// Protocol unavailable — continue with database only}}

So the exact ambiguity #11063 closed on the durable half is still open on the registry half: when getMetaItems throws, the door answers 200 with { packages, total } built from the database alone, and total is reported as a complete count either way. Nothing on the wire separates "these are all the packages" from "these are the packages I could still see". The durable-sourced entries keep source: 'database', which reads as provenance rather than as a warning that the registry half is absent.

This is the same standing family ruling — a read that could not happen must not be reported as a read that found nothing (#10965 · #10677 / PR #10788 · #10789 / PR #10964 · #11063).

Why it was deliberately left out of #11063

Two reasons, both worth carrying into triage rather than re-deriving:

Not measured here

Refs

#11063 · #10965 · #10677 / PR #10788 · #10789 / PR #10964 · ADR-0112

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions