Count pending work: BGG's export lags, so raw queue rows lie

The card read "1 version updates" while upload said "skipping 1 already
done". Both were right. Recon on the live site shows the update DID
apply — the version cell reads "English first edition Year: 2012" and
its radio is checked — but BGG's XML collection export still reports
that collid with no version, even on a forced refresh. diff reads the
API, so it re-queued finished work; the log correctly refused it.

Nothing to fix in the flow: the pipeline card now counts PENDING jobs
(queue rows minus what the log completed) for both to_add and
to_update, reports outstanding failures rather than every failure ever
logged, and when everything queued is already applied it says so and
names the cause. Documented under "BGG's collection export lags the
site" so the next person doesn't chase it as a bug.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
Eric Wagoner
2026-08-05 23:29:25 -04:00
co-authored by Claude Fable 5
parent e44c7e1b92
commit b5e13be335
5 changed files with 65 additions and 39 deletions
+21
View File
@@ -649,3 +649,24 @@ def test_photo_detail_page_serves_with_photos_nav_active(tmp_path):
(current,) = re.findall(r'<a href="([^"]+)" aria-current="page"', html)
assert current == "/photos"
assert 'src="/static/app.js"' in html
def test_pipeline_counts_pending_work_not_queue_rows(tmp_path):
"""A finished job stays in to_update.csv until the next diff, and BGG's
collection export can lag the site — so the card must count what is
actually left to do, or settled work reads as outstanding forever."""
cfg = _cfg(tmp_path)
cfg.to_update_path.write_text(
"action,bgg_id,bgg_name,collid,version_id,version_name\n"
"update,104710,Wiz-War,53429642,117685,English first\n"
)
p = _app(cfg).get("/api/pipeline").json()
assert p["to_update"] == 1 and p["queued_total"] == 1 # nothing done yet
cfg.upload_log_path.write_text(
"action,bgg_id,collid,name,version_id,second_copy,status,timestamp,error\n"
"update,104710,53429642,Wiz-War,117685,,updated,t,\n"
)
p = _app(cfg).get("/api/pipeline").json()
assert p["to_update"] == 0 # applied
assert p["queued_total"] == 1 # still listed until diff reruns