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:
@@ -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.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.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).
|
**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).
|
||||||
|
|||||||
@@ -7598,9 +7598,11 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
const user = this.identity.user
|
const user = this.identity.user
|
||||||
if (!user || !channelId || !guildId) return
|
if (!user || !channelId || !guildId) return
|
||||||
let threadRead = false
|
let threadRead = false
|
||||||
|
let threadParentId = null
|
||||||
try {
|
try {
|
||||||
const ch = await this.db.get(COLLECTIONS.CHANNELS, { guildId, id: channelId })
|
const ch = await this.db.get(COLLECTIONS.CHANNELS, { guildId, id: channelId })
|
||||||
threadRead = !!(ch && isThreadChannel(ch))
|
threadRead = !!(ch && isThreadChannel(ch))
|
||||||
|
if (threadRead) threadParentId = ch.parentId || null
|
||||||
} catch {
|
} catch {
|
||||||
/* channel lookup optional */
|
/* channel lookup optional */
|
||||||
}
|
}
|
||||||
@@ -7640,8 +7642,10 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
channelId,
|
channelId,
|
||||||
guildId,
|
guildId,
|
||||||
threadRead,
|
threadRead,
|
||||||
|
parentId: threadParentId,
|
||||||
isDm: guildId === DM_GUILD_ID,
|
isDm: guildId === DM_GUILD_ID,
|
||||||
clearedInboxCount
|
clearedInboxCount,
|
||||||
|
clearedMentions: true
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (threadRead) {
|
if (threadRead) {
|
||||||
@@ -11023,7 +11027,15 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
targetId: thread.id
|
targetId: thread.id
|
||||||
})
|
})
|
||||||
this.emit('channel', merged)
|
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 }
|
return { thread: { ...merged, tags: postTags }, message }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.log.error('forum.post error', {
|
this.log.error('forum.post error', {
|
||||||
@@ -11074,7 +11086,9 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
threadId: thread.id,
|
threadId: thread.id,
|
||||||
parentId: parent.id,
|
parentId: parent.id,
|
||||||
parentType: parent.type,
|
parentType: parent.type,
|
||||||
threadName: thread.name || threadName
|
threadName: thread.name || threadName,
|
||||||
|
fromMessage: !!messageId,
|
||||||
|
hasRootMessage: !!messageId
|
||||||
})
|
})
|
||||||
return thread
|
return thread
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -11195,7 +11209,14 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
targetId: threadId
|
targetId: threadId
|
||||||
})
|
})
|
||||||
this.emit('channel-update', merged)
|
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
|
return merged
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.log.error('thread.archive error', {
|
this.log.error('thread.archive error', {
|
||||||
|
|||||||
Reference in New Issue
Block a user