one_d4: treat chess.com archive 404 as indexing failure (#1360) - #1381
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 4a07b1c | Commit Preview URL Branch Preview URL |
Aug 14 2026, 12:37 AM |
aaylward
commented
Aug 14, 2026
| // swept (DataAvailabilityResolver reads a missing row as "gone"), and would make the | ||
| // period cache miss forever, refetching an empty archive on every request. | ||
| metrics.increment(ARCHIVE_FETCHES, Map.of("result", "error")); | ||
| throw new IllegalStateException( |
Collaborator
Author
There was a problem hiding this comment.
ISE doesn't seem quite right here
There was a problem hiding this comment.
Agreed — switched to ChessComApiException(404, …) so it matches the other non-success archive outcomes. IllegalStateException was leftover from the altitude panel preferring “any RuntimeException” over inventing a typed 404; wrong call for a wire failure ChessClient had flattened.
Collaborator
Author
There was a problem hiding this comment.
RTE would have been fine here too fwiw
There was a problem hiding this comment.
Switched to plain RuntimeException.
aaylward
marked this pull request as ready for review
August 14, 2026 00:23
…nth (#1360) Empty months are HTTP 200 with an empty games list. ChessClient still maps 404 to Optional.empty(); IndexWorker now fails the request on that shape instead of COMPLETE-ing it as indexed-with-zero-games. Co-authored-by: Andy Aylward <aaylward@users.noreply.github.com>
Review: IllegalStateException mislabeled a chess.com wire failure. Co-authored-by: Andy Aylward <aaylward@users.noreply.github.com>
Prefer a plain RTE over ChessComApiException for the Optional.empty() failure path. Co-authored-by: Andy Aylward <aaylward@users.noreply.github.com>
aaylward
force-pushed
the
cursor/chess-com-404-empty-month-5f43
branch
from
August 14, 2026 00:36
336d86f to
4a07b1c
Compare
aaylward
enabled auto-merge (squash)
August 14, 2026 00:36
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.
Closes #1360.
Problem
ChessClientmaps every chess.com 404 toOptional.empty(), andIndexWorkertreated that as “no games this month,” completing the request as success. Empirically, empty months are HTTP 200 with{"games":[]}; a 404 is a missing player or an upstream failure on a listed archive.Fix (IndexWorker only)
No
ChessClientchange. In the month loop:Optional.empty()→ archive-fetcherror, throwRuntimeException, fail the request (retryable), do not upsert an empty periodgames→ empty-month path (period row,MONTHS=empty,ARCHIVE_FETCHES=no_archive) as beforeTests
a404OnAnArchiveChessComListsIsAnErrorNotAnEmptyMontha200WithEmptyGamesStillRecordsAnEmptyMonthAndCompletesmetrics_archive404IsCountedAsErrorNotEmptyMonthGamesResponseinstead ofOptional.empty()Verification
bazel testIndexWorkerTest, IndexWorkerLifecycleTest, RequestLeaseCeilingTest, RequestLeaseOwnershipTest, IndexResponseWireTestscripts/mutation-checkkilled both branch mutations on the new empty/404 splitFollow-up for typed client results /
x-chesscom-matched: #1382.