comicbox doctor --online: verify each source's credentials live - #231
Merged
Merged
Conversation
`comicbox doctor --online all` (or `--online metron,comicvine`) sends exactly one request per configured source named and puts the answer on that source's row: OK with the rate-limit windows it left, MISCONFIGURED for rejected credentials, WARN for a rate limit, ERROR for anything else. A configured source that isn't named keeps its offline row with "unverified: add --online all (1 API request)"; one with no credentials is never sent a request. --online keeps its required argument, as in a run, so every hint says `--online all`. Each source owns its cheapest call through a new abstract OnlineSource.probe(): Metron's series_type_list, and Comic Vine's one-row list_origins, whose bucket tagging never touches. The probe builds a private client rather than the shared one, with no response cache, so neither a cached answer nor a session another caller built can stand in for the server's, and closes it after. It never goes through with_retry, which can sleep for minutes on a rate limit, and Comic Vine's skips the request when its local origins bucket is spent, since simyan would block for twice its timeout waiting for a slot. A response without X-RateLimit-* headers turns the row into a WARN naming a proxy or bot check, read off the counter the existing response hook already keeps. Probe traffic carries "(cli; doctor)" in the User-Agent so Metron's operators can tell it from tagging. ComicVineOnlineSource._build_session is split so the probe shares its client construction without the REFRESH unlink or cache maintenance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ajslater
force-pushed
the
feature/doctor-online
branch
from
October 4, 2026 03:00
8f0d03e to
c5ff53c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follows #230 (merged); rebased onto develop, so this is one commit.
comicbox doctor --online all(or--online metron,comicvine) sends exactly one request per configured source named, and that answer replaces the source's offline status:burst 19/20, daily 4999/5000 left)AuthenticationError)X-RateLimit-*headers (a proxy or bot check in front of Metron)A configured source that isn't named keeps
unverified: add --online all (1 API request). A source without credentials is never sent a request.--onlinekeeps its required argument, so every hint says--online all.How
OnlineSource.probe(), so each format package owns its cheapest call: Metron'sseries_type_list, and Comic Vine's one-rowlist_origins, whose bucket tagging never touches._close_shared_online_sessions()".with_retry: the doctor reports the first answer. Comic Vine skips the request when its local origins bucket is spent, because simyan would otherwise block for twice its timeout.(cli; doctor)in the User-Agent.ComicVineOnlineSource._build_sessionis split into_new_client(), so the probe shares client construction without the REFRESH unlink or cache maintenance.Test plan
make fix,make lint,make tymake test: 2390 passed, 1 skipped. The new tests fake the transport belowrequests, so mokkari's and simyan's own error handling runs for real: 200, 401, 403, 429/420, 5xx, connection error, header-less HTML, a spent local bucket, uncached and unshared clients, and the User-Agent.comicbox doctor --online allverified both real keys (one request each).🤖 Generated with Claude Code