Phase 788: guild-mesh-reconnected on rejoin and peer-drop recovery (v0.8.755)
Emit after zero-peer mesh rejoin and when _recoverGuildMeshAfterPeerDrop completes with active peers. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Application facade: one `PearcordPlatform` class that wires identity, database, guild mesh, DMs, invites, voice, discovery, bots, and dozens of feature modules for the Pearcord desktop sidecar and companion. **Mixin sources:** [`mixins/README.md`](mixins/README.md) — `domain/`, `json-export/`, `runtime/{core,mesh,guild-sync,search-discovery,partition-heal,view,voice-dm,features}/`. Architecture: [PLATFORM_MIXINS.md](../../docs/PLATFORM_MIXINS.md). Regenerate after manifest edits: `cd apps/pearcord && npm run regenerate:platform-mixins`. OTA prestage recursively verifies symbols under `mixins/` — [RELEASE.md](../../docs/RELEASE.md#prestage-sync-file-deps).
|
Application facade: one `PearcordPlatform` class that wires identity, database, guild mesh, DMs, invites, voice, discovery, bots, and dozens of feature modules for the Pearcord desktop sidecar and companion. **Mixin sources:** [`mixins/README.md`](mixins/README.md) — `domain/`, `json-export/`, `runtime/{core,mesh,guild-sync,search-discovery,partition-heal,view,voice-dm,features}/`. Architecture: [PLATFORM_MIXINS.md](../../docs/PLATFORM_MIXINS.md). Regenerate after manifest edits: `cd apps/pearcord && npm run regenerate:platform-mixins`. OTA prestage recursively verifies symbols under `mixins/` — [RELEASE.md](../../docs/RELEASE.md#prestage-sync-file-deps).
|
||||||
|
|
||||||
|
**Phase 788 (v0.8.755):** `guild-mesh-reconnected` on zero-peer rejoin + peer-drop recovery emit. Bundle: `npm run test:ci-phase788`.
|
||||||
|
|
||||||
**Phase 787 (v0.8.754):** Role gossip + `guildRoles`/`memberRoleLinks` GUILD_SYNC → `guild-sync-ready` with `roles`. Bundle: `npm run test:ci-phase787`.
|
**Phase 787 (v0.8.754):** Role gossip + `guildRoles`/`memberRoleLinks` GUILD_SYNC → `guild-sync-ready` with `roles`. Bundle: `npm run test:ci-phase787`.
|
||||||
|
|
||||||
**Phase 785 (v0.8.752):** `voiceOccupancy` slice → `guild-sync-ready` + `voice-state` emit. Bundle: `npm run test:ci-phase785`.
|
**Phase 785 (v0.8.752):** `voiceOccupancy` slice → `guild-sync-ready` + `voice-state` emit. Bundle: `npm run test:ci-phase785`.
|
||||||
|
|||||||
@@ -375,6 +375,7 @@ _wireGuild (guildInstance) {
|
|||||||
}
|
}
|
||||||
if (type === 'join') {
|
if (type === 'join') {
|
||||||
const gid = this.guild?.guild?.id
|
const gid = this.guild?.guild?.id
|
||||||
|
const hadZeroPeer = !!(gid && this._meshZeroPeerSinceByGuild.has(gid))
|
||||||
if (gid) this._setGuildMeshBounded(gid, false)
|
if (gid) this._setGuildMeshBounded(gid, false)
|
||||||
this._clearGuildMeshPeerRetry(gid)
|
this._clearGuildMeshPeerRetry(gid)
|
||||||
const joinedAt = Date.now()
|
const joinedAt = Date.now()
|
||||||
@@ -405,6 +406,15 @@ _wireGuild (guildInstance) {
|
|||||||
meshPeerCount: this.guild?.peers?.size ?? 0
|
meshPeerCount: this.guild?.peers?.size ?? 0
|
||||||
})
|
})
|
||||||
if (peerId) this._scheduleMemberEnsureFromMeshPeer(peerId, gid)
|
if (peerId) this._scheduleMemberEnsureFromMeshPeer(peerId, gid)
|
||||||
|
const meshPeerCount = this.guild?.peers?.size ?? 0
|
||||||
|
if (hadZeroPeer && meshPeerCount > 0) {
|
||||||
|
this.emit('guild-mesh-reconnected', {
|
||||||
|
guildId: gid,
|
||||||
|
meshPeerCount,
|
||||||
|
peerId: peerId || null,
|
||||||
|
recoveredFromZeroPeer: true
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const conn = peerId ? this.guild?.peers?.get(peerId) : null
|
const conn = peerId ? this.guild?.peers?.get(peerId) : null
|
||||||
if (gid && conn) {
|
if (gid && conn) {
|
||||||
|
|||||||
@@ -830,6 +830,15 @@ async _recoverGuildMeshAfterPeerDrop () {
|
|||||||
flushed: flush?.flushed || 0,
|
flushed: flush?.flushed || 0,
|
||||||
remaining: flush?.remaining || 0
|
remaining: flush?.remaining || 0
|
||||||
})
|
})
|
||||||
|
const meshPeerCount = this.guild?.peers?.size ?? 0
|
||||||
|
if (meshPeerCount > 0) {
|
||||||
|
this.emit('guild-mesh-reconnected', {
|
||||||
|
guildId,
|
||||||
|
meshPeerCount,
|
||||||
|
peerId: null,
|
||||||
|
recoveredFromPeerDrop: true
|
||||||
|
})
|
||||||
|
}
|
||||||
return { recovered: true, flush }
|
return { recovered: true, flush }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user