fix(rust): protocol 13 — a configuration save that settles after its reload (F9, D179)
The plugin now answers a save once the files are written, with pending and a writeId, and reports the reload later as a config.outcome event. The save is recorded as reloading with a settle_by of two plugin ceilings plus slack on the database's clock; ingest settles the row by (server, writeId), only while it is still reloading, so a replay moves nothing and a late outcome still lands. A row past settle_by reads as lost. GET /admin/rust/config/:serverId/writes/:writeId serves the poll; the page polls it every two seconds, holds the Save button while it waits, and says whether a rolled-back plugin came back on its old file. config.outcome is a staff kind: it carries the server's log tail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
const core = require('./core')
|
||||
|
||||
const clans = require('./model/clans/clans.model')
|
||||
const configDb = require('./model/config/config.db')
|
||||
const configModel = require('./model/config/config.model')
|
||||
const db = require('./model/events/events.db')
|
||||
const engagement = require('./engagement/emit')
|
||||
const links = require('./model/links/links.model')
|
||||
@@ -199,6 +201,18 @@ async function apply(serverId, item, server = null) {
|
||||
await permissionsDb.markDirty(serverId)
|
||||
break
|
||||
|
||||
// ── Protocol 13: how a configuration save's reload ended (F9, D179) ─────
|
||||
//
|
||||
// The save was answered before the reload finished and recorded as
|
||||
// `reloading`; this is the rest of it. Only a row still `reloading` moves,
|
||||
// so a replayed frame changes nothing, and one that arrives after the page
|
||||
// gave up on it (`lost`) still lands — the audit row ends up true either way.
|
||||
case 'config.outcome': {
|
||||
const outcome = configModel.outcomeOf(frame)
|
||||
if (outcome) await configDb.settleWrite(serverId, outcome)
|
||||
break
|
||||
}
|
||||
|
||||
// ── Protocol 6: first-party clans ──────────────────────────────────────
|
||||
//
|
||||
// Each one is told to core as it happens (`ctx.teams.publish`) and written
|
||||
|
||||
Reference in New Issue
Block a user