| … | … | @@ -100,14 +100,22 @@ export class SwarmTransport { |
| 100 | 100 | for (const { name, instance } of this._getMounts()) { |
| 101 | 101 | if (!instance) continue |
| 102 | 102 | |
| 103 | | const base = instance.base |
| 104 | | if (base && typeof base.replicate === 'function') { |
| 105 | | try { |
| 106 | | base.replicate(conn) |
| 107 | | } catch (err) { |
| 108 | | // eslint-disable-next-line no-console |
| 109 | | console.error(`[hyper-svc/swarm] ${name}.base.replicate failed:`, err.message) |
| 103 | // A mount may expose `replicate(conn)` to replicate its own |
| 104 | // autobase(s) — required for MULTI-autobase mounts (e.g. per-org |
| 105 | // HyperOrgs) whose single `.base` getter is undefined or THROWS. |
| 106 | // Otherwise fall back to the single-autobase `.base.replicate`. |
| 107 | // The whole access is wrapped: a throwing `.base` getter must |
| 108 | // never abort the daemon on an incoming connection. |
| 109 | try { |
| 110 | if (typeof instance.replicate === 'function') { |
| 111 | instance.replicate(conn) |
| 112 | } else { |
| 113 | const base = instance.base |
| 114 | if (base && typeof base.replicate === 'function') base.replicate(conn) |
| 110 | 115 | } |
| 116 | } catch (err) { |
| 117 | // eslint-disable-next-line no-console |
| 118 | console.error(`[hyper-svc/swarm] ${name} replicate failed:`, err.message) |
| 111 | 119 | } |
| 112 | 120 | |
| 113 | 121 | if (typeof instance.attachProtocol === 'function') { |