feat(shard)!: declare wire protocol 3 #117
Reference in New Issue
Block a user
No description provided.
Delete Branch "chore/protocol-3-cutover"
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?
What & why
Order 6 of the Protocol 3.0 plan (
v3.md§4) — the website half of the cutover, paired with link #20.The site's declared version is the admin-set
uo_link_config.protocolcolumn, so it has to move with the sidecar'sPROTOCOL_VERSION2 → 3 or every REST call 409s anduoLinkSocketcloses the WS on thews.hellomismatch. Five places carry the number and all five move together:server/db/schema.sqluoLinkConfig.model.jsDEFAULT_PROTOCOL— what a site with nothing saved yet declaresuoLinkClient.js,uoLinkSocket.jsconfig.protocol || 1fallbacksShardAdmin.jsx,.env.exampleThe two fallbacks are unreachable today (
toSafe()always fillsprotocol), but an unset value quietly sending1is exactly the confusing 409 the version check exists to prevent, so they move too rather than sitting there two bumps stale.The migration is one-shot, and that is the only subtle part
schema.sqlis re-run on every boot, and every other statement in its migration block is an idempotentADD COLUMN IF NOT EXISTS/MODIFY. A bareUPDATE uo_link_config SET protocol = 3would not be idempotent in the sense that matters:protocolis admin-editable, so an operator who deliberately pinned an older sidecar in Admin → Shard would be silently un-pinned on their next restart. So it is gated on a marker row insettings, written after the UPDATE:protocol < 3rather than= 2also carries across an install still on the old default of1, which could not have been talking to a v2 sidecar anyway. A fresh install has no row to update and simply gets the marker plus the new column default.UOLINK_PROTOCOLstill overrides for anyone who wants to pin.Merge order matters. This lands on
edge; then the fouredge→mainPRs merge together, and that merge is the cutover.How it was tested
Against the local MariaDB, through
ensureSchema()— the same code path the server runs on boot, not hand-applied SQL:protocol = 2, column default1, no marker → after one run:protocol = 3, default3, marker written.2by hand and re-ranensureSchema()→ it stayed 2. The one-shot property holds, so an operator's deliberate pin survives restarts.673server tests,47client tests, andnpm run buildall green. No route changed, so the Swagger spec and route manifest are untouched.Checklist
AI-assisted contributions (required)
Claude Code. I have reviewed and understandevery change, and take responsibility for it. AI-authored commits are
marked with a
Co-Authored-By/Assisted-Bytrailer.License
(GNU GPL v3.0 or later), and I have the right to contribute it.