@cluesmith/codev 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1026,6 +1026,17 @@
1026
1026
  }
1027
1027
  }
1028
1028
 
1029
+ // Abort SSE connection on page unload to free connection slots.
1030
+ // fetch+ReadableStream SSE doesn't auto-close like EventSource,
1031
+ // so without this, reloads leak connections until Chrome's 6-per-origin
1032
+ // limit is exhausted and all subsequent fetches queue forever.
1033
+ window.addEventListener('beforeunload', () => {
1034
+ if (sseController) {
1035
+ sseController.abort();
1036
+ sseController = null;
1037
+ }
1038
+ });
1039
+
1029
1040
  // Subscribe to SSE for push notifications
1030
1041
  subscribeToEvents();
1031
1042