Skip to main content

Module reannounce

Module reannounce 

Source
Expand description

Re-announcing held manifests after a sync epoch change (#781).

When the feed answers a cursor with 409 error.sync.cursor_stale (SyncError::is_stale_cursor), the server rebuilt this library’s index and may have lost rows. The client resyncs from zero, and then every asset it holds that the resynced feed does not list is re-announced: its chain-head provenance record goes to POST /v1/sync/reannounce, manifests only, never bytes (Server Filesystem § Sync Epoch and Client Re-Announce).

Two pieces, so the orchestration is testable without a server:

  • unlisted is the pure walk: the held assets the feed does not list, in the order held;
  • batches cuts them into requests the server accepts, by count and by size;
  • SyncConsumer::reannounce sends one batch through the generated operation.

reannounce_unlisted is the three together. What the server answers is per manifest: a missing_blobs answer is the caller’s cue to re-upload through the transfer protocol, which is the push path’s to do, never this module’s.

Structs§

HeldManifest
One asset the client holds: its id and its chain head’s provenance record, the exact bytes an upload sends as the provenance blob.
ReannounceResult
One manifest’s answer.

Enums§

ReannounceOutcome
What the server did with one re-announced manifest.

Constants§

MAX_BATCH_BYTES
The most manifest bytes one request carries, before base64.
MAX_BATCH_MANIFESTS
The most manifests one request carries: half the server’s per-request ceiling, so a server that lowers it within reason still accepts a full batch.

Functions§

batches
Cut manifests into requests of at most MAX_BATCH_MANIFESTS manifests and MAX_BATCH_BYTES bytes, in order.
reannounce_unlisted
Re-announce every held asset listed does not name, batch by batch, and return each answer paired with the asset the client sent it for.
unlisted
The held assets listed does not name, in the order held: what to re-announce.