Repository navigation
fix(events): deliver administrator default changes to every viewer - #2754
Conversation
#2718 limited user_settings delivery to the connection's own account, which also dropped the administrator-default event #2365 publishes with no account. Mark that event for every viewer explicitly and let only an envelope with the marker and no account or profile through, so personal settings events keep their isolation. Closes #2748 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Problem
Closes #2748
Related issue: N/A
Validation tasks: none. #2718 listed #1180 C1 and #1181 C1 (not yet run); this change keeps the profile isolation those cases cover. #2365 listed #1228 C1, which this change does not reach.
When an administrator changes a server-wide default (title art, or the Next Up defaults), connected clients are supposed to get a
user_settings.changedevent withscope: "default"so viewers inheriting the default re-read their settings. Onmainthat event reaches no one, on either events socket.#2365 publishes the event with no account and no profile, because it is meant for every viewer. #2718, merged a minute later, made
user_settingsdelivery require the connection's own account, so an event with no account is now dropped everywhere. Each passed CI alone. Onmain,TestAdminDefaultChangeReachesEveryViewerfails, and so does the Go test job on any pull request's merge ref.Approach
The administrator-default event is now marked for every viewer explicitly. The events socket delivers a
user_settingsevent to every connection only when it carries that marker and names no account and no profile. Every other settings, state, and notification event goes through #2718's account and profile checks unchanged, so a personal event that loses its account by mistake still reaches no one.The marker is an internal field on the event envelope. It travels over the event bus between nodes and is not part of any client frame, so clients see no contract change. This fixes all three administrator defaults (title art and both Next Up settings), which share one publisher. No other publisher on the personal channels sends events without an account.
Treating any
user_settingsevent without an account as a broadcast would also work and needs no new field. I didn't do that because it turns a publisher bug that forgets the account into a broadcast, which is the case #2718 pinned as rejected.docs/realtime-api.mdanddocs/settings-api.mdnow describe the every-viewer event.Validation
main(dd3f7a6):TestAdminDefaultChangeReachesEveryViewertimes out waiting for the event. It passes with this change.-makes it fail again.user_stateor notifications, and still respectsAdminOnlyand missing claims. The v2 socket isolation test now also expects the default change on bound and unbound sockets, alongside the existing rejections. A remote-playback handoff receives it too. Removing the filter change fails all four tests.go build ./...,gofmt,go vet,make lint-changed,make lint-router-recovery, andgo test ./...pass. No web files changed.Evidence
No screen changes; clients re-read settings again when an administrator changes a default. The page holds the test runs before and after.
Evidence: https://evidence.siloserver.org/r/silo-server/admin-default-events/
Risks
In a cluster, the event reaches every viewer only once every node runs this change. Until then, nodes without it drop the event, as all nodes do today. Personal-event isolation does not depend on the rollout.
Checklist
AI Disclosure
codex exec, read-only),gh, Go toolchain🤖 Generated with Claude Code