Skip to content

v0.4.4 - a rebuild that fails leaves the site up

Choose a tag to compare

@siracozmen01 siracozmen01 released this 06 Oct 10:18

A rebuild can no longer take the site down, and every module builds without
the modules it merely listens to. Upgrade with blysis update, then update
Credits, Currency, Forum, Minecraft link, Store and
Vote from Admin > Modules.

A failed rebuild left no site

Blysis rebuilds itself in place after a module install, and at boot when the
build and the installed modules disagree. Both ran next build into the live
.next, and next build starts by emptying it:

  • During every install-time build the server kept rendering pages that
    name chunks that were already gone. Visitors got pages with no scripts or
    styles: /_next/static/chunks/... answered 404 with HTML.
  • A build that failed left no build at all. The next start stopped at
    "BUILD_ID is missing" and stayed down. One module that did not type-check
    took the whole site with it.

A rebuild is now staged: it is written beside the live build, which the
site keeps serving untouched, and only a finished build replaces it - at the
next start, before the server reads .next. A failed build is thrown away and
the site goes on exactly as it was, admin panel included, so the module can be
removed. A replacement cut off by a crash is finished or rolled back on the
next start. A boot with no build at all is now rebuilt rather than refused.

Running outside Docker: start through npm start, not next start. Its new
prestart puts an install's build live; systemd and pm2 bring the process back
that way.

The install-time build's limit goes from 5 to 45 minutes - a full module set
outgrew five on a small machine, and a killed build was a lost one - and its
output buffer from 1 MB, which a chatty build could exceed and be killed for,
to 64 MB.

Modules that did not build without another module

A hook's types are declared by the module that emits it. Nine listeners leaned
on those types, so the site's build failed with TypeScript errors whenever the
emitting module was not installed:

Installed Without Fixed in
Forum, Store, Vote Leaderboard Forum 1.12.1, Store 2.46.3, Vote 1.6.3
Store CSV import/export, Comparison table Store 2.46.3
Credits, Currency Store Credits 1.9.1, Currency 1.6.1
Minecraft link Member profiles Minecraft link 1.6.1

Each listener now states the shape it reads; with both modules installed,
typecheck:modules still holds it against the declared contract. Every module
set was checked: all ninety together, and ninety minus each of the 29 modules
others listen to. A new test fails on a listener that leans on a declaration
neither core, its own module nor one of its dependencies provides.

Also

  • Store 2.46.2 - migration 018_a_bulk_discount_covers_a_shelf failed a
    fresh install (42703 "productId" does not exist). It only surfaced once
    0.4.3 fixed 014 ahead of it. All 52 migrations of all ninety modules now run
    clean on a fresh database.
  • demo:reset brings the Prisma client and the module registries in line
    with the installed modules before seeding, so a reset run in a container of
    its own (a Kubernetes CronJob, docker compose run) seeds cross-module data
    too - the comparison table now compares a real shelf.
  • source-map-js 1.2.2 for GHSA-68fv-2mgg-jv7q (high), reached through
    postcss.