OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-issues commits / b0c47a8

hyper-issues: surface pairing descriptor + HyperIssues.resumePairing (survive restart)
createInvite now also returns the persistable descriptor; resumePairing (descriptor, swarm) re-registers the repo-invite pairing member after a restart. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b0c47a82ac80f09a5e8cc2b2b2ea1b761914fdf5
by plankatron <fleeky@gmail.com> · 2026-05-28T01:51:06.000Z

Changed files (1) +16 -2

lib/hyper-issues.js +16 -2
……@@ -18,7 +18,7 @@
1818 * tracker.localKey // exchange via P2P for addWriter on the inviter
1919 */
2020
21import { Room, createRoomPairing, joinRoomPairing, decodeRoomPairingInvite } from 'hyper-rooms'
21import { Room, createRoomPairing, joinRoomPairing, resumeRoomPairing, decodeRoomPairingInvite } from 'hyper-rooms'
2222import { issuesSchema, DEFAULT_LABELS } from './schema.js'
2323
2424export class HyperIssues {
……@@ -118,7 +118,21 @@ export class HyperIssues {
118118 meta: { kind: 'repo', name: opts.name || null }
119119 })
120120 this._pairings.set(pairing.invite, pairing)
121 return { invitation: pairing.invite, close: pairing.close }
121 // descriptor lets the daemon persist + re-register this invite on restart.
122 return { invitation: pairing.invite, descriptor: pairing.descriptor, close: pairing.close }
123 }
124
125 /**
126 * Re-register a persisted repo-invite pairing member after a restart so an
127 * already-shared invite keeps working.
128 * @param {object} descriptor from a prior createInvite()
129 * @param {object} swarm shared Hyperswarm (injected)
130 */
131 resumePairing (descriptor, swarm) {
132 if (!swarm) throw new Error('resumePairing requires { swarm }')
133 const pairing = resumeRoomPairing(this._room, descriptor, swarm)
134 this._pairings.set(descriptor.invitation || ('repo:' + descriptor.discoveryKey), pairing)
135 return pairing
122136 }
123137
124138 async getWriter (userId) {