feat(platform): embed.resolve guildId fallback for Phase 460 (v0.8.423)

Use active guild and channel when message rows omit guildId on link embed queue.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 01:17:44 -04:00
co-authored by Cursor
parent a22527a22b
commit ee5c0b4357
2 changed files with 13 additions and 6 deletions
+2
View File
@@ -35,6 +35,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
| `onboarded`, `identity`, `storagePath`, `db`, `dbPath` | Session state |
| `listGuilds()`, `loadGuild(guildId)`, `createGuild({ name, publicListing? })`, `joinInvite(code)` | Guild session |
**v0.8.423 (Phase 460):** `embed.resolve` span uses active `guildId`/`channelId` fallback; `attachment.stage`/`attachment.read` re-verified. Bundle: `npm run test:phase460-attachments-embeds`. See [ATTACHMENTS.md](../../docs/ATTACHMENTS.md), [EMBEDS.md](../../docs/EMBEDS.md).
**v0.8.422 (Phase 459):** `emoji.upsert` + `sticker.create` spans include `guildId` + `span.fail`; `reaction.toggle` error log includes `guildId`/`channelId` (re-verified). Bundle: `npm run test:phase459-reactions-emojis`. See [REACTIONS.md](../../docs/REACTIONS.md), [EMOJI.md](../../docs/EMOJI.md).
**v0.8.421 (Phase 458):** `channel.delete` span + gossip; `thread.create`, `thread.archive`, `forum.post` spans include `guildId` + `span.fail`. Bundle: `npm run test:phase458-threads-forum`. See [MESSAGE_THREADS.md](../../docs/MESSAGE_THREADS.md), [FORUM_CHANNELS.md](../../docs/FORUM_CHANNELS.md).
+11 -6
View File
@@ -7723,11 +7723,16 @@ class PearcordPlatform extends EventEmitter {
const plain = this._messagePlaintext(msg)
const url = extractFirstUrl(plain)
if (!url) return
const guildId =
msg.guildId ||
(this.mode === 'dm' ? DM_GUILD_ID : this.guild?.guild?.id) ||
null
const channelId = msg.channelId || this.activeChannelId || null
const span = this.log.time('embed.resolve', {
messageId: msg.id,
url,
guildId: msg.guildId || null,
channelId: msg.channelId || null
guildId,
channelId
})
try {
const row = await this.embeds.resolveForContent(plain)
@@ -7741,15 +7746,15 @@ class PearcordPlatform extends EventEmitter {
}
span.end({
resolved: !!row,
guildId: msg.guildId || null,
channelId: msg.channelId || null
guildId,
channelId
})
} catch (err) {
this.log.error('embed.resolve error', {
messageId: msg.id,
url,
guildId: msg.guildId || null,
channelId: msg.channelId || null,
guildId,
channelId,
error: err?.message || String(err)
})
span.fail(err)