fix(db): own the two settings seeds, and repair the protocol-3 one-shot (phase 3, slice 4) #5
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/own-settings-seeds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The module-uo half of Phase 3 slice 4. Pairs with website#140 (merge this one first) and docs#139.
What moves
Core's
schema.sqlseeded two settings rows that name a game concept:game_account_signup— the row slice 3 deliberately kept the key of — and the one-shot migration markeruo_link_protocol_3_migrated. BothINSERT IGNOREstatements move into this module's fragment. The keys are unchanged: they are live rows on every existing install, and renaming one silently resets an operator's choice to the default.The second one was a live defect
Pre-extraction these two statements were adjacent in core's schema:
Slice 1 moved the
UPDATEhere and left theINSERTin core. The two files do not run together — core's schema is replayed in full before any module fragment (MODULE_API.md §2.6) — so the marker existed before the guard ever read it, and the one-shot could never fire. An install carrying a protocol-2 row would have stayed pinned at 2 against a v3 sidecar: every REST call 409, the WS closed onws.hello. That is exactly the failure the migration exists to prevent.Latent rather than live, and only because
edgehas not cut over: it bites an install that first boots a post-slice-1 build while already holding auo_link_configrow.Verification
Against a real MariaDB, all three states:
protocol = 2, no markerprotocol = 2pinned back, marker presentThe third is the half that makes it a one-shot rather than a re-bump — an operator who deliberately pins an older sidecar in Admin → Shard has to stay pinned.
Tests
server/test/schemaFragment.test.js(new, 8 tests) asserts the order, because that is the property that broke and nothing else can see it: both files were individually valid SQL and both replayed cleanly. It also restates the fragment rules core validates at load time — leading-verb allowlist,IF NOT EXISTS, grandfathered table prefixes — for the same reasonmanifest.test.jsrestates the manifest rules: a mistake should fail in this repo's CI, which can say what is wrong, rather than on an install, where the symptom is a module that is simply absent. Its statement splitter is a character walk, because a comment in this file contains quotes.client/test/api.test.js(new, 6 tests) takes the five assertions that stayed behind in core'sapiClient.test.jswhen the bindings moved in slice 1 — the atlas-vs-/shardpath split, the query-string filtering, the slug encoding, the admin atlas methods — plus a new one pinning the seven admin URLs the shipped Android app calls by name. Its fakewindow.__rgcarries the real react/react-dom/router rather than stubs:src/core.jscompares its imported bindings against the published ones, so stubs make every run print the exact wording of a real defect.367 server (+8) and 40 client (+6) tests pass; chunk builds clean,
check:importsandcheck:externalsboth OK.