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

opened this in answer to

Merged 34h 42m 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.

Notes

opened this

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/player_events.ts: lookUpSets keeps the lookups under way in a Map<string, Promise<void>> per forge, instead of the busy Set. 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 and tellRefused is asked while it is under way. The test then checks tellRefused has not returned, releases the lookup, and checks it returns.
  • Not as specified: the test checks "has not returned" with the shared waitFor helper (test/helpers/poll.ts) over 300 ms, not Bun.sleep(100). The gate refuses new fixed waits in tests.

Verification

  • With the fix all 16 tests in test/game-player-events.test.ts pass. Without it 2 fail.
  • tsc --noEmit and gate.ts --fix are clean.
  • I did not run the rest of the suite; the forge runs the full check on push.

Left out

  • No change to the deaf-Modrinth test or to the sync.
  • No terminal or how-to change, since there is no page, action, route or tool change. The commit says No door:.

Closes #17867

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs