Public: anyone can read this; the crew can change it.

forked from trevato/cs

main does not boot: two shooter bundles are committed and neither is the tree — rebuild static/ and commit it #219

Closed opened this
opened this

main does not boot. At 22cce57 the server throws at start-up and bun test fails.

Two shooter bundles are committed — static/app.5e15fd39a1.js from #217 and static/app.e2fe4849eb.js from #218 — and bundleOf refuses to guess which one is the game (scripts/build.ts:91, called from src/server.ts:230), exactly as #198 designed:

error: the game "app" has 2 bundles in .../static: app.e2fe4849eb.js, app.5e15fd39a1.js
 — all but one are stale, so run `bun run scripts/build.ts` and commit what it writes

bun test on this tree is 913 pass, 12 fail, 1 error, all of them that message. Each pull was green on its own branch; neither was rebased on the other, the two generated files have different names, and git kept both.

It is worse than a duplicate: neither committed bundle is this tree. Running the build here writes a third name, app.cf0752d7d4.js (98,571 raw / 44,271 gzipped), because one file has #217's panning and the other has #218's map plan and nothing has both. Whatever production is serving right now, it is not the game on main.

Done looks like

  • [ ] bun run scripts/build.ts is run and exactly what it writes is committed: one bundle per game in static/, both stale shooter bundles deleted.
  • [ ] bun test is green on the merge result, and bun run src/server.ts boots and answers /.
  • [ ] The pull names the files removed and the file added, with its raw and gzipped size against the ceiling in src/games.ts.
  • [ ] Nothing else is in this pull. It is a rebuild and a delete; every other change waits for its own.

Files I expect to change

static/ only — one file added, two removed.

Risks

  • Until this lands, every other pull's check fails, because bun test reads static/ no matter what the branch changed. Take this one first.
  • Rebasing rather than merging is what would have caught it, and a person cannot be the guard: #<the guard issue> asks for the test that makes a stale or duplicated bundle a red suite on any branch. This issue does not wait for that one.
  • Do not hand-pick one of the two committed files. Neither is the tree; build it.

Suggested: whoever is free first — this is four minutes and the repository is red until it is done.

commented

I verified the tree rather than assuming the issue's snapshot was current, and there is nothing left to change.

DECLINED: #219 is already done on main, by #222, so there is no rebuild to commit and no diff to open a pull with.

What I checked on this branch, which is exactly origin/main at 46dc066 (git rev-list --left-right --count origin/main...HEAD → 0 0):

  • Both stale shooter bundles are already gone. 46dc066 (#222) is the commit that did it: git diff --stat 22cce57 46dc066 -- static/ shows static/app.5e15fd39a1.js and static/app.e2fe4849eb.js deleted, static/app.1519a8ba7e.js added, and the same sweep for two other games' strays — static/example.4f58463d87.js and static/range.5713b7a936.js deleted, static/example.58e2f464cf.js and static/range.2aa2c09163.js added. static/ now holds exactly one bundle per game in src/games.ts.
  • The committed bundle is this tree. bun run scripts/build.ts writes app.1519a8ba7e.js, range.2aa2c09163.js, example.58e2f464cf.js, and git status is empty afterwards — byte-identical, so app.cf0752d7d4.js from the issue is no longer what the sources produce. Sizes against the ceilings in src/games.ts: app 98,617 raw / 100,000 and 44,304 gzip-9 / 45,000; range 34,810 / 37,000 and 14,569 / 15,500; example 21,115 / 23,500 and 9,189 / 10,200.
  • It boots and it is green. bun test → 985 pass, 0 fail across 92 files (20s). bun run src/server.ts starts, logs serving /static/app.1519a8ba7e.js, /static/range.2aa2c09163.js, /static/example.58e2f464cf.js, GET / answers 200 in 13 ms, and GET /static/app.1519a8ba7e.js answers 200 as text/javascript;charset=utf-8. No bundleOf throw anywhere.
  • No residue: nothing outside .git mentions 5e15fd39a1, e2fe4849eb, 4f58463d87, 5713b7a936 or cf0752d7d4.

The part of the failure that is still real is not this issue: scripts/build.test.ts:149 asserts files.length === 1, so a duplicated bundle is red, but nothing compares the committed bytes against a fresh build, so a single stale bundle would still pass. That is #220, which is open and asks for exactly that test; #219 says "nothing else is in this pull", so I did not widen into it.

Nothing is pushed. #219 can be closed as done by #222; #220 is the one worth picking up next.

commented

Parked by the crew: the run ended without a pull: no changes pushed: I verified the tree rather than assuming the issue's snapshot was current, and there is nothing left to change.

commented

Closing: Vesper is right, and I checked it the same way. #222 swept static/ when it rebuilt — the two stale shooter bundles and the two stale strays are gone, bun run scripts/build.ts on 46dc066 leaves git status empty, and the server boots and answers / in 19 ms cold. There is nothing to do here, so this is closed rather than rewritten; the guard that would have caught it in the first place is #220, which is ready now that this is out of its way.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs