feat(platform): Phase 484 thread and forum span metadata (v0.8.447)

Add fromMessage, wasArchived, parentId on read, and forum titleLen/hasTags.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 06:10:56 -04:00
co-authored by Cursor
parent 5c4e35cbc0
commit 6989dc0110
2 changed files with 27 additions and 4 deletions
+2
View File
@@ -39,6 +39,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
**v0.8.430 (Phase 467):** `voice.leave` span `end` includes `leavingIsStage`; `screen.start` span `end` includes `label`. Bundle: `npm run test:phase467-voice-stage`. See [VOICE.md](../../docs/VOICE.md), [STAGE_CHANNELS.md](../../docs/STAGE_CHANNELS.md).
**v0.8.447 (Phase 484):** `thread.create` `fromMessage`/`hasRootMessage`; `thread.archive` `wasArchived`/`threadName`; `thread.read` `parentId`/`clearedMentions`; `forum.post` `titleLen`/`hasTags`. UI threads compositor split + hints. Bundle: `npm run test:phase484-threads`. See [MESSAGE_THREADS.md](../../docs/MESSAGE_THREADS.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).
+25 -4
View File
@@ -7598,9 +7598,11 @@ class PearcordPlatform extends EventEmitter {
const user = this.identity.user
if (!user || !channelId || !guildId) return
let threadRead = false
let threadParentId = null
try {
const ch = await this.db.get(COLLECTIONS.CHANNELS, { guildId, id: channelId })
threadRead = !!(ch && isThreadChannel(ch))
if (threadRead) threadParentId = ch.parentId || null
} catch {
/* channel lookup optional */
}
@@ -7640,8 +7642,10 @@ class PearcordPlatform extends EventEmitter {
channelId,
guildId,
threadRead,
parentId: threadParentId,
isDm: guildId === DM_GUILD_ID,
clearedInboxCount
clearedInboxCount,
clearedMentions: true
})
} catch (err) {
if (threadRead) {
@@ -11023,7 +11027,15 @@ class PearcordPlatform extends EventEmitter {
targetId: thread.id
})
this.emit('channel', merged)
span.end({ guildId, threadId: thread.id, tagCount: postTags.length, parentChannelId: forum.id, messageId: message.id })
span.end({
guildId,
threadId: thread.id,
tagCount: postTags.length,
hasTags: postTags.length > 0,
titleLen: postTitle.length,
parentChannelId: forum.id,
messageId: message.id
})
return { thread: { ...merged, tags: postTags }, message }
} catch (err) {
this.log.error('forum.post error', {
@@ -11074,7 +11086,9 @@ class PearcordPlatform extends EventEmitter {
threadId: thread.id,
parentId: parent.id,
parentType: parent.type,
threadName: thread.name || threadName
threadName: thread.name || threadName,
fromMessage: !!messageId,
hasRootMessage: !!messageId
})
return thread
} catch (err) {
@@ -11195,7 +11209,14 @@ class PearcordPlatform extends EventEmitter {
targetId: threadId
})
this.emit('channel-update', merged)
span.end({ guildId, threadId, archived: !!archived, parentId: ch.parentId || null })
span.end({
guildId,
threadId,
archived: !!archived,
wasArchived: !!archived,
parentId: ch.parentId || null,
threadName: ch.name || null
})
return merged
} catch (err) {
this.log.error('thread.archive error', {