Files
fusion/.changeset/shared-badge-pubsub.md
gsxdsm 4927346f57 feat(KB-136): add shared badge pub/sub for multi-instance deployments
- Add BadgePubSub interface with Redis and in-memory adapters

- Implement cross-instance badge snapshot delivery via Redis pub/sub

- Add message validation, echo loop prevention, and structured caching

- Support graceful fallback to in-memory mode when Redis unavailable

- Update ServerOptions for dependency injection and add documentation
2026-03-30 12:52:07 -07:00

1.1 KiB

@dustinbyrne/kb
@dustinbyrne/kb
patch

Add shared badge pub/sub support for multi-instance dashboard deployments

The dashboard now supports cross-instance badge update delivery via Redis pub/sub. When running multiple dashboard instances behind a load balancer, badge updates detected on one instance are now delivered to subscribed WebSocket clients on other instances.

Configuration:

  • KB_BADGE_PUBSUB_REDIS_URL - Redis connection URL (enables multi-instance mode)
  • KB_BADGE_PUBSUB_CHANNEL - Pub/sub channel name (default: kb:badge-updates)

Features:

  • Badge snapshots are fanned out across instances while preserving per-instance focused polling
  • Echo loop prevention via source instance deduplication
  • Structured snapshot cache for late subscription replay
  • Graceful fallback to in-memory mode when Redis is not configured
  • Clean adapter shutdown without connection leaks

API Changes:

  • ServerOptions now accepts optional badgePubSub and githubPoller for dependency injection
  • Package exports include GitHubPollingService and badge pub/sub interfaces