Skip to content

Handle NaNs as page numbers from metadata service and add retries#21

Merged
ryanmccartney merged 4 commits intomainfrom
issue-#20-isbn-lookup-failing
May 9, 2026
Merged

Handle NaNs as page numbers from metadata service and add retries#21
ryanmccartney merged 4 commits intomainfrom
issue-#20-isbn-lookup-failing

Conversation

@ryanmccartney
Copy link
Copy Markdown
Owner

@ryanmccartney ryanmccartney commented May 9, 2026

❓Context

Occasionally, Open Library returns NaN as a page number, this update improves handling of this case. This fixes part of the issue raised in #20.

Sometime 503 responses are observed from the Google Books API. This appears to be intermittent. Makes metadata fetching more robust by introducing retries. Fixes main issue raised in #20.

📖 Description

Explicitly check page numbers are a number, if not default to 0.

Makes three retries with 500ms in between for failed metadata requests (only 5xx series errors). If all fail the final response is delivered.

Adds improved logging to isolate reason for metadata failures in future.

Changes in the codebase

Updates to book model, handle NaN and fix naming. Add fetchRetry function and uses this for making metadata requests.

  • - Frontend changes
  • - Backend changes
  • - CI/CD and helper script changes
  • - Documentation changes

@ryanmccartney ryanmccartney changed the title Handle NaNs as page numbers from metadata service Handle NaNs as page numbers from metadata service and add retries May 9, 2026
@ryanmccartney ryanmccartney merged commit 6ab35e7 into main May 9, 2026
2 checks passed
@ryanmccartney ryanmccartney deleted the issue-#20-isbn-lookup-failing branch May 9, 2026 09:30
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.

1 participant