Skip to content

Add puregate websocket to the dashboard server. - #12

Merged
koculu merged 3 commits into
mainfrom
wire-puregate-websocket
Nov 27, 2026
Merged

koculu merged 3 commits into
mainfrom
wire-puregate-websocket

Conversation

@koculu

@koculu koculu commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Integrates PureGate.WebSocket v1.0.0 into the ZoneTree.Analytics Dashboard, replacing continuous HTTP polling with WebSocket-driven live updates and change-aware report refreshing.

Changes

Server

  • Add an authenticated WebSocket endpoint at /_dashboard/live.
  • Stream real-time visitor counts and report change notifications.
  • Share report sampling across subscribers watching the same site, reducing redundant queries.
  • Track report changes following ingestion flushes, visitor erasure, engine reopening, reporting date changes, and index maintenance.
  • Release engine leases between samples to avoid blocking engine reconfiguration.
  • Continuously validate session validity and site-level access permissions throughout active connections.

Dashboard UI

  • Integrate the @puregate/web-socket TypeScript client.
  • Update live visitor counts directly through WebSocket streams.
  • Refresh reports only when changes are detected, instead of continuously polling unchanged data.
  • Automatically fall back to HTTP polling when the WebSocket connection is unavailable.
  • Restore live subscriptions after reconnection.
  • Suspend background refreshing when the browser tab is hidden.
  • Respect the configured auto-refresh interval.

Testing and Documentation

  • Add server-side tests covering live updates, site access restrictions, and session revocation.
  • Extend frontend and browser integration tests to cover WebSocket-driven updates and polling fallback.
  • Document WebSocket configuration and reverse proxy requirements.

Benefits

  • Reduced redundant HTTP requests and database queries.
  • Lower server resource consumption when multiple users monitor the same site.
  • More efficient live dashboard updates.
  • Automatic recovery from connection interruptions.
  • No changes required to existing public reporting APIs.

Deployment

Reverse proxies must forward WebSocket upgrades on /_dashboard/live to enable live reporting. HTTP polling remains available as a fallback.

@koculu
koculu merged commit efc6a0f into main Nov 27, 2026
6 checks passed
@koculu
koculu deleted the wire-puregate-websocket branch November 27, 2026 19:30
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