Skip to content

feat: broadcast announcement badge updates in real time - #783

Merged
gaidheal1 merged 3 commits into
stagingfrom
feat/announcement-published-realtime-badge
Aug 14, 2026
Merged

feat: broadcast announcement badge updates in real time#783
gaidheal1 merged 3 commits into
stagingfrom
feat/announcement-published-realtime-badge

Conversation

@gaidheal1

Copy link
Copy Markdown
Member

Summary

Publishing an Announcement now pushes a WebSocket announcement_published event to online players, invalidating the announcements/unread-count queries so the Navbar badge appears immediately instead of only on refresh or full remount.

Changes

  • Announcement.save() broadcasts on the unpublished→published transition, following the existing maintenance-mode broadcast pattern (server_management/models.py).
  • publish_selected_announcements admin action now saves rows individually (not queryset.update()) so save() — and the broadcast — actually fires.
  • Frontend wires the new announcement_published action into handleGlobalWebSocketEvent / WebSocketContext to invalidate the relevant react-query keys (ANNOUNCEMENTS_QUERY_KEY, ANNOUNCEMENT_UNREAD_QUERY_KEY).

Testing

  • All backend and frontend tests pass (per user).
  • tsc --noEmit and eslint clean on touched frontend files.

🤖 Generated with Claude Code

gaidheal1 and others added 3 commits August 14, 2026 11:17
Publishing an Announcement now pushes a WebSocket "announcement_published"
event to online players, which invalidates the announcements/unread-count
queries so the Navbar badge appears immediately instead of only on refresh
or remount.

- Announcement.save() broadcasts on the unpublished->published transition
- publish_selected_announcements admin action saves rows individually
  (not queryset.update()) so the broadcast actually fires
- frontend wires the new action into handleGlobalWebSocketEvent /
  WebSocketContext to invalidate the relevant react-query keys

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gaidheal1
gaidheal1 merged commit 82932f3 into staging Aug 14, 2026
6 checks passed
@gaidheal1
gaidheal1 deleted the feat/announcement-published-realtime-badge branch August 14, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant