Skip to content

feat: add an independent foundation for a future reliable WebSocket connection [WPB-23826]#20620

Open
screendriver wants to merge 16 commits intodevfrom
websocket
Open

feat: add an independent foundation for a future reliable WebSocket connection [WPB-23826]#20620
screendriver wants to merge 16 commits intodevfrom
websocket

Conversation

@screendriver
Copy link
Member

@screendriver screendriver commented Mar 9, 2026

EpicWPB-23826 [Web] Optimize websocket implementation

Pull Request

Summary

We want a new WebSocket connection path that can be developed, tested, and observed independently from the existing application flow. The intent of this pull request is to create a safe, isolated starting point for a future reliable WebSocket connection without affecting the current production path.

This change introduces a separate, feature-flagged WebSocket connection foundation with clear ownership at the application boundary. This pull request does not replace the existing production WebSocket/event flow. It does not integrate the new connection path with the legacy event repository or Knockout-based implementation.

It also makes the connection state visible for manual verification when the feature is enabled. The new path is only enabled when the application is started with:

?enabled-features=reliable-websocket-connection

Unfortunately the previous one #20618 was closed accidentally.

Screen Recording 2026-03-09 at 15 44 01


Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)


Screenshots or demo (if the user interface changed)

Notes for reviewers

  • Trade-offs:
  • Follow-ups (linked issues):
  • Linked PRs (e.g. web-packages):

Introduce an effectful wrapper around the existing WebSocket connection
state machine. This adds a concrete boundary for connection lifecycle,
state observation, message sending, and cleanup without yet wiring it
into bootstrap or React.
Introduce a WebSocket lifecycle state machine that owns transport
creation, message forwarding, and cleanup through an invoked callback
actor. This is the first step toward moving WebSocket lifecycle
authority from the imperative wrapper into the state machine itself.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 10
  • Failed: 0
  • Skipped: 3
  • 🔁 Flaky: 0
  • 📊 Total: 13
  • Total Runtime: 97.0s (~ 1 min 37 sec)

Subscribe to the managed WebSocket connection in AppMain and expose the
current connection state through the application context. This gives
React components a reactive connection-state snapshot while keeping
connection ownership at the bootstrap boundary.
@screendriver screendriver changed the title feat: add managed WebSocket connection wrapper [WPB-23826] feat: add an independent foundation for a future reliable WebSocket connection [WPB-23826] Mar 9, 2026
@screendriver screendriver marked this pull request as ready for review March 9, 2026 15:24
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants