feat(platform): attachment and embed span metadata (Phase 502)
Add filenameLen on attachment.stage, attachmentId/isImage on attachment.read, embed.gossip span, and gossipSent on embed.resolve. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -61,6 +61,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
|
||||
|
||||
**v0.8.464 (Phase 501):** `reaction.toggle` `added`/`hadMeBefore`/`gossipSent`; `reaction.gossip` span on mesh fanout. UI `syncReactionPanelsDuringGuildLoading`. Bundle: `npm run test:phase501-reactions`. See [REACTIONS.md](../../docs/REACTIONS.md).
|
||||
|
||||
**v0.8.465 (Phase 502):** `attachment.stage` `filenameLen`; `attachment.read` `attachmentId`/`isImage`; `embed.gossip` span; `embed.resolve` `gossipSent`. UI split attachment guild-loading compositor. Bundle: `npm run test:phase502-attachments`. See [ATTACHMENTS.md](../../docs/ATTACHMENTS.md), [EMBEDS.md](../../docs/EMBEDS.md).
|
||||
|
||||
**v0.8.446 (Phase 483):** `guild.search` `includeMesh`/`queryLen`; `pin.list` `pinCount`. UI search compositor split + hints. Bundle: `npm run test:phase483-search`. See [SEARCH.md](../../docs/SEARCH.md).
|
||||
|
||||
**v0.8.445 (Phase 482):** `message.send` `hasAttachment`/`hasSticker`; `message.edit` `contentChanged`; `message.delete` `wasOwn`. UI messaging compositor + hints. Bundle: `npm run test:phase482-messaging`. See [MESSAGING.md](../../docs/MESSAGING.md).
|
||||
|
||||
@@ -5090,6 +5090,7 @@ class PearcordPlatform extends EventEmitter {
|
||||
channelId,
|
||||
mimeType: rowMime,
|
||||
byteLength,
|
||||
filenameLen: String(filename || '').length,
|
||||
isImage: String(rowMime || '').startsWith('image/')
|
||||
})
|
||||
return row
|
||||
@@ -8082,13 +8083,28 @@ class PearcordPlatform extends EventEmitter {
|
||||
})
|
||||
try {
|
||||
const row = await this.embeds.resolveForContent(plain)
|
||||
let gossipSent = false
|
||||
if (row && this.guild) {
|
||||
const gossipSpan = this.log.time('embed.gossip', {
|
||||
messageId: msg.id,
|
||||
guildId,
|
||||
channelId,
|
||||
urlHost: (() => {
|
||||
try {
|
||||
return new URL(url).host
|
||||
} catch (_) {
|
||||
return null
|
||||
}
|
||||
})()
|
||||
})
|
||||
this.guild.gossipLinkEmbed({
|
||||
...row,
|
||||
messageId: msg.id,
|
||||
channelId: msg.channelId,
|
||||
guildId: msg.guildId
|
||||
})
|
||||
gossipSpan.end({ resolved: true, guildId, channelId })
|
||||
gossipSent = true
|
||||
}
|
||||
let urlHost = null
|
||||
try {
|
||||
@@ -8101,7 +8117,8 @@ class PearcordPlatform extends EventEmitter {
|
||||
urlHost,
|
||||
urlLen: url.length,
|
||||
hasTitle: !!(row?.title),
|
||||
hasImage: !!(row?.image || row?.thumbnail)
|
||||
hasImage: !!(row?.image || row?.thumbnail),
|
||||
gossipSent
|
||||
})
|
||||
} catch (err) {
|
||||
this.log.error('embed.resolve error', {
|
||||
|
||||
Reference in New Issue
Block a user