@shardworks/spider-apparatus 0.1.143 → 0.1.144

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardworks/spider-apparatus",
3
- "version": "0.1.143",
3
+ "version": "0.1.144",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,13 +19,13 @@
19
19
  "hono": "^4.7.11",
20
20
  "yaml": "^2.0.0",
21
21
  "zod": "4.3.6",
22
- "@shardworks/nexus-core": "0.1.143",
23
- "@shardworks/fabricator-apparatus": "0.1.143",
24
- "@shardworks/stacks-apparatus": "0.1.143",
25
- "@shardworks/tools-apparatus": "0.1.143",
26
- "@shardworks/animator-apparatus": "0.1.143",
27
- "@shardworks/clerk-apparatus": "0.1.143",
28
- "@shardworks/codexes-apparatus": "0.1.143"
22
+ "@shardworks/stacks-apparatus": "0.1.144",
23
+ "@shardworks/nexus-core": "0.1.144",
24
+ "@shardworks/clerk-apparatus": "0.1.144",
25
+ "@shardworks/tools-apparatus": "0.1.144",
26
+ "@shardworks/animator-apparatus": "0.1.144",
27
+ "@shardworks/fabricator-apparatus": "0.1.144",
28
+ "@shardworks/codexes-apparatus": "0.1.144"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "25.5.0"
@@ -527,6 +527,11 @@
527
527
  sessionLogSpinner.style.display = '';
528
528
  }
529
529
 
530
+ // Track whether the stream completed normally so the onerror handler
531
+ // (which fires when EventSource auto-reconnects after connection close)
532
+ // does not show a spurious "disconnected" badge.
533
+ var streamDone = false;
534
+
530
535
  sessionEventSource = new EventSource(
531
536
  '/api/spider/session-stream?sessionId=' + encodeURIComponent(engine.sessionId)
532
537
  );
@@ -562,6 +567,9 @@
562
567
  sessionEventSource.addEventListener('done', function (e) {
563
568
  var data;
564
569
  try { data = JSON.parse(e.data); } catch (err) { data = {}; }
570
+ // Mark stream as intentionally done before closing to prevent the
571
+ // onerror handler from showing a spurious "disconnected" badge.
572
+ streamDone = true;
565
573
  stopSessionStream();
566
574
  if (sessionLogSpinner) {
567
575
  sessionLogSpinner.style.display = 'none';
@@ -582,6 +590,7 @@
582
590
  });
583
591
 
584
592
  sessionEventSource.addEventListener('error', function (e) {
593
+ if (streamDone) return;
585
594
  var data;
586
595
  try { data = JSON.parse(/** @type {MessageEvent} */(e).data || '{}'); } catch (err) { data = {}; }
587
596
  if (sessionLogSpinner) {
@@ -594,6 +603,8 @@
594
603
 
595
604
  sessionEventSource.onerror = function () {
596
605
  // Network-level error (browser fires this on connection failure / premature close).
606
+ // Skip if the stream completed normally — the connection close is expected.
607
+ if (streamDone) return;
597
608
  if (sessionEventSource) {
598
609
  stopSessionStream();
599
610
  if (sessionLogSpinner && sessionLogSpinner.style.display !== 'none') {