0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-13 05:15:01 +02:00
Epid b9a94c688e feat(websocket): Phase 1 — replace SSE notification count with WebSocket
Add a thin in-memory pubsub broker and a SharedWorker-based WebSocket
client to deliver real-time notification count updates. This replaces
the SSE path for notification-count events with a persistent WebSocket
connection shared across all tabs.

New files:
- services/pubsub/broker.go: fan-out pubsub broker (DefaultBroker singleton)
- services/websocket/notifier.go: polls notification counts, publishes to broker
- routers/web/websocket/websocket.go: /-/ws endpoint, per-user topic subscription
- web_src/js/features/websocket.sharedworker.ts: SharedWorker with exponential
  backoff reconnect (50ms initial, 10s max, reconnect on close and error)

Modified files:
- routers/init.go: register websocket_service.Init()
- routers/web/web.go: add GET /-/ws route
- services/context/response.go: add Hijack() to forward http.Hijacker
  so coder/websocket can upgrade the connection
- web_src/js/features/notification.ts: port from SSE SharedWorker to WS SharedWorker
- webpack.config.ts: add websocket.sharedworker entry point

Part of RFC #36942.
2026-03-30 06:37:53 +03:00
..
2026-03-29 10:24:30 +00:00
2026-03-29 10:24:30 +00:00
2026-02-11 03:22:33 +00:00
2026-03-27 04:39:24 +01:00
2026-03-23 07:49:25 +00:00