| … | … | @@ -477,8 +477,26 @@ if (SPACEDUST) { |
| 477 | 477 | console.log(JSON.stringify({ msg: 'inbound', event, ...detail })) |
| 478 | 478 | } |
| 479 | 479 | }) |
| 480 | | await inbound.start() |
| 481 | | console.log(JSON.stringify({ msg: 'inbound lens', enabled: true, subjects: ROSTER.length, budgetBytes: RETENTION_BUDGET })) |
| 480 | // ⛔ NOT AWAITED. This is the inbound lens: it subscribes to a remote index and backfills over HTTP. |
| 481 | // Awaiting it made a LOCAL, P2P-FIRST node refuse to serve until a REMOTE WEB SERVICE answered — and |
| 482 | // on 2026-08-24 that is exactly what happened. The bridge saturated, this fetch had no deadline |
| 483 | // (bare-fetch silently drops `timeout`: its Request destructures only body/method/headers/signal/ |
| 484 | // agent, verified in node_modules/bare-fetch/lib/request.js), and the daemon hung in boot forever |
| 485 | // while every P2P capability it owns was already available. Both backends did it simultaneously, |
| 486 | // which left the proxy with no healthy node, which kept the fetch from ever completing — a deadlock |
| 487 | // that could only be broken by restarting Apache. |
| 488 | // |
| 489 | // A phone, tabertron and ashatron are P2P nodes. Nothing on the web side may gate them serving. |
| 490 | // The lens is an ENHANCEMENT: it fills in replies from outside this node's window. Without it the |
| 491 | // timeline still renders, so it starts in the background and reports failure instead of blocking. |
| 492 | // |
| 493 | // Deliberately not "bounded with a timeout" either. A deadline would have turned a permanent hang |
| 494 | // into a slow boot, when the correct answer is that a P2P node's readiness does not depend on this |
| 495 | // at all. |
| 496 | inbound.start().then( |
| 497 | () => console.log(JSON.stringify({ msg: 'inbound lens', enabled: true, subjects: ROSTER.length, budgetBytes: RETENTION_BUDGET })), |
| 498 | (e) => console.error(JSON.stringify({ msg: 'inbound lens FAILED to start — serving anyway, replies from outside this node will be missing', error: (e && e.message) || String(e) })) |
| 499 | ) |
| 482 | 500 | } else { |
| 483 | 501 | console.log(JSON.stringify({ msg: 'inbound lens', enabled: false })) |
| 484 | 502 | } |