fix(profile): prefetch banner bytes over mesh before drive read (v0.8.19)

_ensureBannerAttachmentReady calls _prefetchBannerFromPeers when guild
mesh is active. _gossipProfileCosmetics awaits guild gossip broadcast.

Supports Phase 54 live peer banner fetch in PearcordPlatform.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-22 00:07:20 -04:00
co-authored by Cursor
parent d14fc164f5
commit 24ba5b1f45
+4 -1
View File
@@ -602,7 +602,7 @@ class PearcordPlatform extends EventEmitter {
async _gossipProfileCosmetics () {
const payload = await this._profileCosmeticGossipPayload()
if (!payload) return
if (this.guild) this.guild.gossipProfileCosmetic(payload)
if (this.guild) await this.guild.gossipProfileCosmetic(payload)
if (this.contacts) this.contacts.broadcastProfileCosmetic(payload)
}
@@ -630,6 +630,9 @@ class PearcordPlatform extends EventEmitter {
}
if (!row) throw new Error('banner attachment not found')
if (!this.attachments.hasLocalBytes(row)) {
if (this.guild) {
await this._prefetchBannerFromPeers(attachmentId).catch(() => {})
}
await this.readAttachmentBytes(attachmentId)
}
return row