feat(routing,collab,trust): manually expand sticky-session and collab modules
Hyper-P2P Module Tests / unit-all (push) Has been cancelled

- sticky-session: unbind, listSessions, bindBatch, remote remove gossip
- cursor-presence: peersInDoc, pruneStale
- whiteboard-op: listRooms, opCount, pruneRoom
- key-rotation: listActiveKeys, revoke, tick activation sweep

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 02:19:01 -04:00
co-authored by Cursor
parent cd048cb8c8
commit 3de911fc2e
4 changed files with 83 additions and 2 deletions
+18 -2
View File
@@ -49,9 +49,25 @@ class HyperP2PKeyRotation extends EventEmitter {
return out
}
_maybeActivate (keyId) {
listActiveKeys () {
return [...this._active.keys()]
}
revoke (keyId) {
assertNonEmpty(keyId, 'keyId')
const ok = this._active.delete(keyId)
this._pending.delete(keyId)
if (ok) this.emit('revoked', { keyId })
return ok
}
tick (now = Date.now()) {
for (const keyId of this._pending.keys()) this._maybeActivate(keyId, now)
return this._active.size
}
_maybeActivate (keyId, now = Date.now()) {
const list = this._pending.get(keyId) || []
const now = Date.now()
for (const e of list) {
if (e.activateAt <= now) {
const active = { keyId, material: e.newMaterial, activatedAt: now }