fix(rust): nothing names who is online by default #11
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/presence-visibility"
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?
The org lead's rule, settled 2026-09-22 while answering phase 9's roster question: nothing tells who is online by default. The narrowest audience, staff, applies unless an operator deliberately widens it. A count is fine; names are not. Design of record:
docs/modules/rust/PLAN.md§23 (docs PR alongside).The public site had been breaking that rule since phase 4. This PR puts four surfaces behind one setting:
GET …/servers/:id/online){ players: [], hidden: true, count, audience }(same shape, so an older client renders an empty list rather than breaking)player.connected,.disconnected,.respawned,.death,.chat,.tallypresenceHiddensays so, and the server's own story (wipe, start, shutdown) stayslastSeenstaff·signed_in·public, with a fleet-wide default in a newrust_settingstable and an optional per-server override (rust_servers.presence_audience, NULL = inherit). An unknown stored word narrows to staff.usersrow (ctx.users.getById), not taken from the token, so a demotion or a ban takes effect on the next request.Cache-Control: private, no-store,Vary: Cookie, Authorization.GET/PUT /admin/rust/visibility(requireRole('admin'), validated whole before anything is written, one activity-log row per save) and a new admin page, Rust visibility.A defect four phases old, found by the walk
Every empty state in this module rendered as a blank box. Core's
EmptyStaterenders its children only, and this module passedtitle/message(the Integration Kit template's shape), which React drops without a word. On the org lead's steer ("we do not want to break other integrations like the UO module") it's fixed module-side with a smallEmptywrapper: nothing core or module-uo renders changes. A new client test refuses a titledEmptyStateor aPageHeader subtitle, and it was proven by planting an offence and watching it fail. The kit's template is fixed in Integration-kit alongside this PR.Verified
180 server tests, 40 client tests,
check:imports,check:bundle,check:externals, the regenerated OpenAPI fragment and the frozen route manifest, the last generated against core at the pinned sha as CI does it.Walked against that core with the module installed and a stand-in sidecar:
count: 2and no names, a feed of wipes only, and nolastSeen. A moderator and an admin got all of it.signed_inopened the names to a player and not to an anonymous visitor. A per-serverpublicoverride opened them to anonymous on that server alone.Not walked in a browser: the admin page itself. The walk does not type a password into a browser. The page's API is proven above, and it's left for your review at
/admin/rust/visibility.AI disclosure
Written with Claude Code (Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
The org lead's rule, settled 2026-09-22: who is online is always the narrowest audience - staff - unless an operator deliberately widens it, and a count is fine where a list of names is not. The public site broke that in three places since phase 4. The Online tab named every player, the feed carried joins, respawns, deaths, chat and tallies, and the leaderboard's lastSeen - refreshed every minute by a gather tally - said who was on as plainly as either. All three now sit behind one setting: * PRESENCE_KINDS, a subset of the public allowlist, gated per request. Below the audience the feed keeps the server's own story (wipe, start, shutdown) and says presenceHidden rather than looking quiet. * the Online route answers { players: [], hidden, count, audience } - same shape, so an older client renders empty rather than breaking. * rungs staff / signed_in / public, fleet-wide default in a new rust_settings table with an optional per-server override on rust_servers; an unknown stored word narrows to staff. * the viewer's standing is RE-READ from the users row (ctx.users.getById), not taken from the token, so a demotion or a ban applies on the next request. Walked: a moderator demoted mid-session lost the roll call on the same cookie. * per-viewer answers are Cache-Control: private, no-store. * GET/PUT /admin/rust/visibility (requireRole admin) and an admin page, Rust visibility; every save is one activity-log row. The browser walk also found every empty state in this module rendering as a blank box. Core's EmptyState renders children only; this module passed title/message (the shape the Integration Kit template teaches) and React dropped both without a word. Fixed module-side with a small Empty wrapper - nothing core or module-uo renders changes - and a client test that refuses a titled EmptyState or a PageHeader subtitle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY