Skip to content

feat(cli): nirium verify --gateway repeatable with retry/backoff fallback - #265

Merged
Eras256 merged 2 commits into
mainfrom
issue-135-verify-retry-gateway
Nov 7, 2026
Merged

Eras256 merged 2 commits into
mainfrom
issue-135-verify-retry-gateway

Conversation

@M0nsxx

@M0nsxx M0nsxx commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

-g, --gateway on nirium verify is now repeatable and tried in order as fallbacks, with --retries/--timeout:

nirium verify <cid> --gateway https://gateway.pinata.cloud --gateway https://ipfs.io --retries 3
  • A 404 retries the same gateway up to --retries times with a flat backoff - a fresh IPFS pin can take a moment to propagate, so a 404 there doesn't necessarily mean the CID is wrong.
  • Any other failure (a real error status, a timeout) moves straight to the next gateway - retrying the same one wouldn't help.
  • If every gateway 404s after exhausting retries, that's reported as availability: "not_yet_available" - distinct from a hash mismatch, because nothing was actually fetched to compare against. A mix of real errors across gateways reports gateway_error instead.
  • Human output now says NOT YET AVAILABLE, not MISMATCH, for the former case.
  • No behavior change for the existing single-gateway, no-failure path.

Test plan

Closes #135

…back

-g/--gateway is now repeatable and tried in order. A 404 retries the
SAME gateway up to --retries times with a flat backoff (a fresh pin can
take a moment to propagate, so a 404 there isn't necessarily wrong); any
other failure (real error, timeout) moves straight to the next gateway
instead. When every gateway 404s after exhausting retries, that's
reported as availability: "not_yet_available" - distinct from a real
hash mismatch, since the document was never actually fetched.

8 new tests against local HTTP servers covering: 404-then-200 recovery
on retry, fallback to a second gateway, all-down (not-yet-available),
a non-404 error skipping straight to the next gateway, mixed failures
(gateway_error), the human-output distinction, and --retries/--timeout
validation. Full suite 67/67, no change to existing verify behavior for
a single gateway with no failures.

Closes #135

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@Eras256 Eras256 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — repeatable --gateway, backoff retry on 404, "not yet available" correctly separated from "hash mismatch" in both text and --json. CI green (4/4), exit codes unchanged as required.

…y-gateway

# Conflicts:
#	packages/cli/CHANGELOG.md
#	packages/cli/package.json

@Eras256 Eras256 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving - conflict resolved cleanly against main, 84/84 tests pass locally, CI green (4/4). Ready to merge.

@Eras256
Eras256 merged commit 071f7bf into main Nov 7, 2026
4 checks passed
@M0nsxx M0nsxx mentioned this pull request Nov 7, 2026
Eras256 pushed a commit that referenced this pull request Nov 7, 2026
…k, report (#263, #268, #265, #266) (#269)

Bumps packages/cli 3.0.1 -> 3.1.0 (new public commands, not a patch) and
dates the Unreleased CHANGELOG section. All four changes are already
merged to main.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: nirium verify should retry and fall back to another gateway

2 participants