You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The legacy WebSocket layer in @dotcms/dotcms-js (Protocol, WebSocketProtocol, LongPollingProtocol, DotWebSocketConfig, DotcmsEventsService) is an outdated abstraction that predates our current Angular/NgRx patterns. It's also missing reactivity to site CRUD events — when a site is published, archived, stopped, or deleted, the UI doesn't reflect the change without a manual refresh, and the UN_PUBLISH_SITE system event isn't even defined on the backend so stop-site events are silently swallowed.
This task replaces the legacy stack with a modern, typed WebSocket service and wires site CRUD events into the global store so the UI reacts automatically.
Acceptance Criteria
New DotEventsSocket in libs/data-access: native WebSocket, exponential backoff with jitter, typed on<T>(eventType) API, reactive status$() stream
New withWebSocket() NgRx signal store feature in libs/global-store: manages connection lifecycle, exposes wsStatus signal and typed event observables
Legacy Protocol, WebSocketProtocol, LongPollingProtocol, DotWebSocketConfig, and getWebSocketConfig() are removed
All DotcmsEventsService.subscribeTo() / subscribeToEvents() call sites migrated to DotEventsSocket.on<T>() (DotMessageDisplayService, DotToolbarNotificationsComponent, DotLargeMessageDisplayComponent, IframeComponent, IframePortletLegacyComponent)
DotSiteComponent refreshes the site list (debounced) on any site WebSocket event and auto-switches to the default site when the selected site is archived/stopped/deleted
Java SystemEventType.UN_PUBLISH_SITE added so stop-site events are dispatched
Toolbar reacts to SWITCH_SITE events via a dedicated DotSiteNavigationEffect
WebSocket reconnects automatically after server restart, with a visible reconnecting indicator
yarn nx test data-access and yarn nx test global-store pass
Description
The legacy WebSocket layer in
@dotcms/dotcms-js(Protocol,WebSocketProtocol,LongPollingProtocol,DotWebSocketConfig,DotcmsEventsService) is an outdated abstraction that predates our current Angular/NgRx patterns. It's also missing reactivity to site CRUD events — when a site is published, archived, stopped, or deleted, the UI doesn't reflect the change without a manual refresh, and theUN_PUBLISH_SITEsystem event isn't even defined on the backend so stop-site events are silently swallowed.This task replaces the legacy stack with a modern, typed WebSocket service and wires site CRUD events into the global store so the UI reacts automatically.
Acceptance Criteria
DotEventsSocketinlibs/data-access: native WebSocket, exponential backoff with jitter, typedon<T>(eventType)API, reactivestatus$()streamwithWebSocket()NgRx signal store feature inlibs/global-store: manages connection lifecycle, exposeswsStatussignal and typed event observablesProtocol,WebSocketProtocol,LongPollingProtocol,DotWebSocketConfig, andgetWebSocketConfig()are removedDotcmsEventsService.subscribeTo()/subscribeToEvents()call sites migrated toDotEventsSocket.on<T>()(DotMessageDisplayService,DotToolbarNotificationsComponent,DotLargeMessageDisplayComponent,IframeComponent,IframePortletLegacyComponent)DotSiteComponentrefreshes the site list (debounced) on any site WebSocket event and auto-switches to the default site when the selected site is archived/stopped/deletedSystemEventType.UN_PUBLISH_SITEadded so stop-site events are dispatchedSWITCH_SITEevents via a dedicatedDotSiteNavigationEffectyarn nx test data-accessandyarn nx test global-storepassAdditional Context
Tracking PR: #34990