OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-orgs commits / 1a3ea8e

Add replicate(conn) — replicate every tracked org's autobase
A multi-org HyperOrgs has no single `base` (the getter throws on >1), so the daemon swarm transport's single-autobase base.replicate path can't be used. replicate(conn) replicates each tracked org's base; the transport calls it per connection. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1a3ea8ef4816108c5c634789e19f836af9178cd3
by plankatron <fleeky@gmail.com> · 2026-05-26T00:02:25.000Z

Changed files (1) +16 -0

lib/hyper-orgs.js +16 -0
……@@ -86,6 +86,22 @@ export class HyperOrgs {
8686 for (const { room } of this._orgs.values()) await room.base.update()
8787 }
8888
89 /**
90 * Replicate every tracked org's autobase over a raw connection. The
91 * daemon's swarm transport calls this per connection — a multi-org
92 * instance has no single `base` (the getter throws on >1), so the
93 * transport's single-autobase `base.replicate` path can't be used.
94 * corestore.replicate usually covers these cores already; this mirrors
95 * the transport's belt-and-suspenders base.replicate for each org.
96 */
97 replicate (conn) {
98 for (const { room } of this._orgs.values()) {
99 if (room.base && typeof room.base.replicate === 'function') {
100 room.base.replicate(conn)
101 }
102 }
103 }
104
89105 async close () {
90106 for (const { room } of this._orgs.values()) {
91107 try { await room.close() } catch {}