Ma77Ball commented on code in PR #4377:
URL: https://github.com/apache/texera/pull/4377#discussion_r3082702891


##########
frontend/src/app/workspace/service/workflow-websocket/workflow-websocket.service.ts:
##########
@@ -131,8 +133,8 @@ export class WorkflowWebsocketService {
       this.webSocketResponseSubject.next(event as TexeraWebsocketEvent)
     );
 
-    // refresh connection status
-    this.websocketEvent().subscribe(evt => {
+    // refresh connection status — store the reference so it is torn down in 
closeWebsocket()
+    this.statusUpdateSubscription = this.websocketEvent().subscribe(evt => {

Review Comment:
   If openWebsocket() is called multiple times, each call overwrites 
statusUpdateSubscription without killing the previous one, so closeWebsocket() 
can only ever clean up the last subscription, not the earlier leaked ones. The 
fix is to unsubscribe before overwriting.



-- 
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]

Reply via email to