feat(reactions): add spanKind to reaction.toggle/gossip spans (Phase 521)

Tag reaction.toggle and reaction.gossip start/end with spanKind for
diagnostics filtering and agentctl correlation.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 10:57:10 -04:00
co-authored by Cursor
parent 4b35d9a897
commit 2c4a85f51b
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -63,6 +63,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
**v0.8.463 (Phase 500):** `message.send` `replyToId`; `message.edit` `deltaLength`; `message.delete` `hadReactions`/`reactionCount`. UI split messaging composer guild-loading compositor. Bundle: `npm run test:phase500-messaging`. See [MESSAGING.md](../../docs/MESSAGING.md).
**v0.8.484 (Phase 521):** `reaction.toggle` and `reaction.gossip` spans include `spanKind` on start/end. UI extends reaction guild-loading compositor. Bundle: `npm run test:phase521-reactions`. See [REACTIONS.md](../../docs/REACTIONS.md).
**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).
+6 -1
View File
@@ -12355,6 +12355,7 @@ class PearcordPlatform extends EventEmitter {
const guildId = this.mode === 'dm' ? DM_GUILD_ID : this.guild?.guild?.id || null
const channelId = this.activeChannelId
const span = this.log.time('reaction.toggle', {
spanKind: 'reaction.toggle',
messageId,
emoji: String(emoji || '').slice(0, 16),
guildId,
@@ -12377,6 +12378,7 @@ class PearcordPlatform extends EventEmitter {
let gossipSent = false
if (this.mode !== 'dm' && this.guild) {
const gossipSpan = this.log.time('reaction.gossip', {
spanKind: 'reaction.gossip',
messageId,
guildId,
channelId,
@@ -12384,9 +12386,11 @@ class PearcordPlatform extends EventEmitter {
})
this.guild.gossipReaction(result)
gossipSpan.end({
spanKind: 'reaction.gossip',
removed: result?.removed === true,
guildId,
channelId
channelId,
emoji: emojiKey
})
gossipSent = true
}
@@ -12396,6 +12400,7 @@ class PearcordPlatform extends EventEmitter {
(r) => r.messageId === messageId && r.emoji === emojiKey
).length
span.end({
spanKind: 'reaction.toggle',
messageId,
emoji: emojiKey,
emojiLength: emojiKey.length,