Skip to content

fix: lang filter and missing set logos on cold start#146

Merged
Pyronewbic merged 3 commits into
mainfrom
dev
May 25, 2026
Merged

fix: lang filter and missing set logos on cold start#146
Pyronewbic merged 3 commits into
mainfrom
dev

Conversation

@Pyronewbic
Copy link
Copy Markdown
Owner

Summary

  • Default undefined lang (from stale Firestore cache) to "en" so the EN filter returns results instead of classifying all sets as JP
  • Await set metadata fetch before marking card DB ready, ensuring logos are available on first request

Test plan

  • Unit tests pass (311/311)
  • Verify ?lang=en returns EN/both sets on production
  • Verify set logos appear on cold start

… ready

Cached cards without lang field defaulted all sets to JP. Default
undefined lang to EN. Await set metadata fetch before marking card DB
ready so logos are available on first request.
TCGdex JA API uses zero-padded localIds (neo1-001) while EN uses
unpadded (neo1-1). Normalize card IDs before dedup so JA duplicates
are merged with EN cards instead of appearing as separate JP-only
entries with no images.
Startup now always loads from Firestore cache without TTL expiry.
No more background TCGdex re-fetch on every cold start. New
POST /api/card-database/sync (owner-only) compares cached set codes
against TCGdex and only rebuilds when new sets are detected.
Supports ?force=true to bypass the check.
@Pyronewbic Pyronewbic merged commit 3f4ccb1 into main May 25, 2026
10 checks passed
@Pyronewbic Pyronewbic deleted the dev branch May 25, 2026 14:00
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