Review decisions outrank the queue; stop waiting on OUR name for a heading

Two bugs behind one failure. Dungeons & Dragons timed out waiting for a
dialog heading matching our stored name — but BGG 140509's primary name
is "Dragones Y Mazmorras"; we matched it through an ALTERNATE name, so
that heading never appears. The add flow now waits for the Own checkbox
(the form itself) instead: /boardgame/<id>/ already establishes which
game the page is.

And the job should not have run at all. to_add.csv is a snapshot from
the last diff, so any review decision taken afterwards — local,
rejected, wrong-match — was invisible to upload. run_upload now
cross-checks every queued job against the CURRENT matches.csv and skips
those it no longer endorses, naming each and pointing at diff. When
matches.csv is absent or empty it condemns nothing: absence is not a
verdict.

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:02:59 -04:00
co-authored by Claude Fable 5
parent 6e72ef22d1
commit 99c1fbf02d
3 changed files with 111 additions and 5 deletions
+19
View File
@@ -754,3 +754,22 @@ def test_paging_state_survives_reopen_so_page_one_is_clicked():
assert picked is True
assert why == ""
assert dialog.clicked.startswith("Sleeping Gods (English Gamefound")
def test_stale_queue_jobs_are_skipped(tmp_path):
"""to_add.csv is a snapshot from the last diff. A review decision made
afterwards — marking a game local, rejecting it, calling the match
wrong — must win over the stale queue."""
from bggpipe.upload import stale_jobs
queue = [{"bgg_id": "13"}, {"bgg_id": "140509"}, {"bgg_id": "999"}]
matches = [
{"bgg_id": "13", "match_status": "auto"},
{"bgg_id": "140509", "match_status": "local"},
]
stale = stale_jobs(queue, matches)
assert "13" not in stale # still endorsed
assert "now local" in stale["140509"]
assert "no longer matched" in stale["999"]
# unverifiable (no matches.csv at all) never condemns a job
assert stale_jobs(queue, []) == {}