Skip to content

Game database: build the index with the weekly download; CLI e2e tests download nothing - #74

Open
ChakraFusion wants to merge 2 commits into
Liquid-co:dev-publicfrom
ChakraFusion:pr/manifest-index
Open

ChakraFusion wants to merge 2 commits into
Liquid-co:dev-publicfrom
ChakraFusion:pr/manifest-index

Conversation

@ChakraFusion

Copy link
Copy Markdown

Two small changes around the Ludusavi manifest (the game database), one commit each.

1. A ~30 s pause after every weekly manifest download

The manifest is downloaded in the background once a week. Its compact index (ludusavi-index-v2.json) was not built at that point. It was built by whichever caller next found the manifest newer than its index, which parsed the 17.7 MB YAML in the foreground. That caller is a scan, either the background scan or "Scan saves", or tracking a game: TrackGame looks up every game's registry keys in the database first (setUpRegistryCapture → RegistryKeysFor), so tracking any game waited too.

Measured on today's dev-public with the real manifest, opensave scan with an empty home:

State Time
Manifest newer than its index (after every weekly download) 32.2 s
Index in place 3.2 s

The download now builds the index before the new manifest takes its place. It also dates the manifest a second before the index, because the clock can give both files the same time. So after a download nothing is parsed in the foreground. If building the index fails, the manifest still replaces the old one and the next caller builds the index as before.

TestDownloadedManifestArrivesWithItsIndex fails without the change: there is no index after the download.

2. CLI e2e tests no longer fetch the manifest from GitHub

The e2e tests run the CLI as a separate program, so the empty ManifestURL the in-process test daemons get (testutil.NewTestDaemon) doesn't reach it. Each run has a fresh home without a manifest, so it started downloading the 17.7 MB manifest from raw.githubusercontent.com, and a CLI daemon finished that download. So CI was depending on the network for nothing.

OPENSAVE_MANIFEST_URL, when set, now replaces the manifest's address, and set empty turns the download off. The CLI harness sets it empty. TestManifestURLFromTheEnvironment fails without the change. Nothing changes for users, who don't set the variable.

I haven't traced a red CI run to this download, so it's a network dependency removed rather than a failure explained.

Background: the cloud session that ported today's fixes to my fork found both. On the fork the pause hit the first snapshot after a download, because a fork-only feature reads the index there. Upstream it's the scan and tracking a game, measured above.

Checks: the full unit and e2e suites pass locally. Fork CI: green.

🤖 Generated with Claude Code

ChakraFusion and others added 2 commits October 15, 2026 21:04
After every weekly download of the Ludusavi manifest, the next caller that
wanted the game database found the manifest newer than its index and built
the index itself, parsing the 17.7 MB YAML in the foreground. That caller is
a scan (the background scan, or "Scan saves"), or tracking any game:
TrackGame looks up the game's registry keys in the database first
(setUpRegistryCapture -> RegistryKeysFor). Measured with the real
manifest, `opensave scan` takes 32.2 s in that state and 3.2 s with the
index in place.

The background download now builds the index before the manifest takes its
place, and dates the manifest a second before it (the clock can give both
files the same time), so no caller rebuilds it in the foreground.

TestDownloadedManifestArrivesWithItsIndex fails without the change (no
index after the download).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The e2e tests run the CLI as a separate program, out of reach of the
Scanner settings the in-process test daemons get (testutil.NewTestDaemon
sets ManifestURL empty). With a fresh home there is no manifest, so each
run started fetching the 17.7 MB Ludusavi manifest from GitHub, and a CLI
daemon finished the download: CI depending on the network for nothing.

OPENSAVE_MANIFEST_URL, when set, now replaces the manifest's address, and
set empty turns the download off; the CLI harness sets it empty.
TestManifestURLFromTheEnvironment fails without the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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