villebro commented on code in PR #43436:
URL: https://github.com/apache/superset/pull/43436#discussion_r3839295937


##########
superset-frontend/src/middleware/asyncEvent.ts:
##########
@@ -310,21 +257,22 @@ export const waitForAsyncData = async <T = unknown[]>(
 export const init = (appConfig?: AppConfig) => {
   pollingGeneration += 1;
   if (pollingTimeoutId) clearTimeout(pollingTimeoutId);
-  teardownWebSocket();
+
+  config = appConfig || getBootstrapData().common.conf;
+
+  // (Re)connect the shared realtime socket whenever the websocket transport is
+  // enabled — independent of GLOBAL_ASYNC_QUERIES, since realtime list views
+  // (tier-1 entity-change nudges) ride the same socket. Idempotent: a no-op 
when
+  // WEBSOCKET_ENABLED is false, and supersedes any prior socket otherwise.
+  connectRealtime(config);

Review Comment:
   Good catch — fixed in the latest push. `waitersByTaskId` is now initialized 
eagerly at declaration (`new Map()`), so the shared-socket handler is safe when 
a `realtime:*` message arrives with `GLOBAL_ASYNC_QUERIES` off (the socket 
connects on `WEBSOCKET_ENABLED` alone): `applyStatus` finds an empty map and 
no-ops instead of dereferencing `undefined`. Added a regression test.
   
   Note this PR also grew a related feature per maintainer request: task rows 
now live-update on **intermediate** transitions (IN_PROGRESS/progress/abort), 
not just completion — nudges are emitted post-commit from the internal 
status/update/cancel commands, and the nudge now carries the integer `id` (FAB 
can't filter a UUIDType column with `in`, so the batched refetch keys on `id`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to