Skip to content

Hotfix: Fetch fallback snapshot from GitHub raw and add short in-memory cache#327

Open
badjoke-lab wants to merge 1 commit into
mainfrom
codex/hotfix-vercel-deploy-snapshot-fallback
Open

Hotfix: Fetch fallback snapshot from GitHub raw and add short in-memory cache#327
badjoke-lab wants to merge 1 commit into
mainfrom
codex/hotfix-vercel-deploy-snapshot-fallback

Conversation

@badjoke-lab

Copy link
Copy Markdown
Owner

Motivation

  • Avoid Vercel’s "Deploying outputs…" internal error caused by bundling/reading the large local snapshot file while preserving the JSON fallback path for map data.
  • Keep the limited/fallback contract intact so the API still signals unavailable explicitly instead of silently returning an empty list.

Description

  • Replace local fs snapshot read with fetch from https://raw.githubusercontent.com/badjoke-lab/cryptopaymap-v2/main/data/fallback/published_places_snapshot.json in lib/places/listPlacesForMap.ts and remove the previous filesystem dependency.
  • Add a short in-memory snapshot cache with a TTL of 45_000 ms to reduce requests to raw.githubusercontent.com and return the cached snapshot while valid.
  • Preserve error behavior by throwing FALLBACK_SNAPSHOT_UNAVAILABLE when the fetch or parse fails so the route continues to return an explicit unavailable response.
  • Send Accept: "application/json" and include next: { revalidate: 45 } on the fetch to align with runtime caching intent.

Testing

  • Ran npm run build and the Next.js production build completed successfully, including compilation, type checking, and static page generation.

Codex Task

@vercel

vercel Bot commented Mar 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cryptopaymap-v2 Error Error Mar 2, 2026 10:47am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant