Public: anyone can read this; the crew can change it.
An awaited Modrinth lookup waits for the one a sync already began, not "Mods:… #17868
Merged 26h 1m ago, live in production
An awaited Modrinth lookup now waits for the one a sync already started, so tellRefused and needLines no longer return before a set is kept (#17865). What changed src/games/playerevents.ts: lookUpSets keeps the lookups under way in a Map > per forge, instead of the busy Set.
-
Reviews
ApprovedThe fix does what #17865 asked. The in-flight set becomes a Map of key to promise, so an awaited lookup (needLines) joins the one a sync began instead of returning at once with nothing kept. The entry is removed in .finally, so a failed lookup does not stick. The sync path still catches its own rejection (games_routes.ts:71), so no unhandled rejection comes from the shared promise. The new test holds Modrinth, shows tellRefused does not return while the lookup is under way, and returns after release; it would fail on the old code. No new dependency, no new input, no web or terminal surface touched.
Two things I would do next:
- In the test file, move the
waitForimport below the../src/...imports so the import order matches the rest of the file. - The 300 ms negative wait in the test is a fixed wait. Once the Modrinth stub counts its calls, assert on the call count, or on the pending promise, instead of sleeping.
- In the test file, move the
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- An awaited Modrinth lookup waits for the one already under way (#17865) c8343c1
- Full suite red: 3 files in check run 01m8xkn7yvvjtbd07e5qhk1rk4 (#17866) c4333e8
- Sentinel: snapshot-failed was degraded 33 minutes today: The last snapshot failed: list chunks/ failed after 5 attempts: an unexpected error has occurred. The newest that lande… (#17863) 5fa2c54
- Sentinel: cloud-watch:digitalocean/prod was degraded 39 minutes today: The forge could not read digitalocean/prod to check it for stray machines (no answer in time); it is not known to be cl… (#17861) de6ec9b
- Cloud account digitalocean/prod shows more than the forge made (#17857) 137546a
- Cloud account hetzner/prod shows more than the forge made (#17856) be9fa4e
- A repository can have its own account order, tried there without reordering the forge (#17843) 14bd626
- Sentinel: memory-growth was degraded 14 minutes today: The forge's own memory is 4774 MiB, over twice its first-hour 1779 MiB and past the 2176 MiB more its database caches m… (#17860) 8d72195
- Sentinel: backup was degraded 43 minutes today: Primary (s3.us-east-005.backblazeb2.com/openplatform-dr-backups) cannot be read: names snapshots/ failed after 5 attemp… (#17858) ddebb72
- Sentinel: cloud-watch:hetzner/prod was degraded 39 minutes today: The forge could not read hetzner/prod to check it for stray machines (no answer in time); it is not known to be clean. … (#17859) 5c2509f
- A Talk reply names its model, and a turn that reaches its limit says so and offers to go on (#17842) 01d8b2c
- Full suite red: test/page-titles.test.ts (#17847) 63507b9
- The most frequent red checks (client JS/CSS ceilings, batched rows, look prerequisites) are fixed at their cause, no rule loosened (#17836) 339cc69
- /signin answers without a stall on the serving thread (#17835) ff7b4dd
- A run shows which account it took and why, and Settings shows each account's place in the order (#17837) 9b29938
- Talk's context meter uses the model's real window, not 200k (#17841) a1797ca
- Every model call in Talk writes one log line: account, model, seconds, how it ended (#17838) cf3f3e9
- git-upload-pack for a runner job no longer holds the serving thread (#17839) 91265d1
- The maintain duty works in slices and yields to the serving thread (#17840) fadecfc
- resolveAppHostname asks the database once per hostname, not once per call (#17833) cb78eb4
An awaited Modrinth lookup now waits for the one a sync already started, so
tellRefusedandneedLinesno longer return before a set is kept (#17865).What changed
src/games/player_events.ts:lookUpSetskeeps the lookups under way in aMap<string, Promise<void>>per forge, instead of thebusySet. A caller that finds a lookup already running for that box and service returns that promise. The sync still never awaits its own lookup. A failed lookup rejects everyone waiting on it once, and a later call retries it.test/game-player-events.test.ts: the fake Modrinth can be held (held) and reports when it is asked (heard). In "once is an event…", the first lookup is held andtellRefusedis asked while it is under way. The test then checkstellRefusedhas not returned, releases the lookup, and checks it returns.waitForhelper (test/helpers/poll.ts) over 300 ms, notBun.sleep(100). The gate refuses new fixed waits in tests.Verification
test/game-player-events.test.tspass. Without it 2 fail.tsc --noEmitandgate.ts --fixare clean.Left out
No door:.Closes #17867