Phase 470: extend guild.search and pin platform span metadata
Add meshHitCount/localHitCount/mesh on search span end and messageId/pinCount on pin.message and pin.unpin span end. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -186,6 +186,8 @@ Primary consumer: `apps/pearcord/index.js` sidecar reading pear-pipe JSON.
|
||||
|
||||
**v0.8.403:** `stageAttachment`/`readAttachmentPreview` log `attachment.*` spans and errors; `_queueLinkEmbed` logs `embed.resolve` span and `embed.resolve error` on failure.
|
||||
|
||||
**v0.8.433 (Phase 470):** `guild.search` span `end` adds `meshHitCount`/`localHitCount`/`mesh` per scope; `pin.message`/`pin.unpin` span `end` adds `messageId` + `pinCount`. UI `syncSearchPanelsDuringGuildLoading` + composer search hint. Smokes: `test:platform-search-span-metadata-extend`, `test:dev-log-search-errors-tighten`, `test:dev-log-pin-errors-tighten`. Bundle: `test:phase470-search-pins`.
|
||||
|
||||
**v0.8.432:** `notification.markRead` span `end` adds `kind` + `read`; `notification.markAll` adds `inboxCount`; `notification.open` adds `messageId`; `inbox.mark-read`/`thread.read` span `end` adds `threadRead` + `isDm`. Error logs use `error:` key. UI `syncNotificationPanelsDuringGuildLoading` + composer notif hint + thread-read live region. Smokes: `test:platform-notification-span-metadata-extend`, `test:dev-log-notification-errors-tighten`, `test:dev-log-inbox-errors-tighten`. Bundle: `test:phase469-notifications-inbox`.
|
||||
|
||||
**v0.8.416:** `openNotificationTarget` span `end` includes `guildId`; `markAllNotificationsRead` / `markNotificationRead` / `markChannelRead` (`inbox.mark-read` or `thread.read`) span `end` includes `guildId` + `channelId`. Smoke: `test:platform-notification-span-guild-id`. Bundle: `test:phase453-notifications-inbox`.
|
||||
|
||||
@@ -1744,7 +1744,7 @@ class PearcordPlatform extends EventEmitter {
|
||||
this._searchFetchedAt = this._lastSearchMeshMeta.fetchedAt
|
||||
const searchMs = Date.now() - searchStarted
|
||||
this._lastSearchMeshMeta = { ...this._lastSearchMeshMeta, searchMs }
|
||||
endSearchSpan({ count: out.hits?.length || 0, scope: 'forum', searchMs })
|
||||
endSearchSpan({ count: out.hits?.length || 0, scope: 'forum', searchMs, mesh: !!out.mesh, meshHitCount: out.meshHitCount || 0, localHitCount: out.localHitCount || 0 })
|
||||
this._commitSearchCache(cacheKey, out.hits)
|
||||
return out.hits
|
||||
}
|
||||
@@ -1811,7 +1811,7 @@ class PearcordPlatform extends EventEmitter {
|
||||
searchMs
|
||||
}
|
||||
this._searchFetchedAt = this._lastSearchMeshMeta.fetchedAt
|
||||
endSearchSpan({ count: hits.length, scope: 'channel', searchMs })
|
||||
endSearchSpan({ count: hits.length, scope: 'channel', searchMs, localHitCount: hits.length })
|
||||
this._commitSearchCache(cacheKey, hits)
|
||||
return hits
|
||||
}
|
||||
@@ -1836,6 +1836,8 @@ class PearcordPlatform extends EventEmitter {
|
||||
count: filtered?.length || 0,
|
||||
scope: 'guild',
|
||||
mesh: !!out.mesh,
|
||||
meshHitCount: out.meshHitCount || 0,
|
||||
localHitCount: out.localHitCount || 0,
|
||||
searchMs
|
||||
})
|
||||
this._commitSearchCache(cacheKey, filtered)
|
||||
@@ -11245,7 +11247,8 @@ class PearcordPlatform extends EventEmitter {
|
||||
await this.db.insert(COLLECTIONS.PINS, pin)
|
||||
this.guild.gossipPin(pin)
|
||||
this.emit('pin', pin)
|
||||
span.end({ channelId: pin.channelId, guildId })
|
||||
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: pin.channelId })
|
||||
span.end({ channelId: pin.channelId, guildId, messageId, pinCount: pinRows.length })
|
||||
return pin
|
||||
} catch (err) {
|
||||
this.log.error('pin.message error', {
|
||||
@@ -11270,8 +11273,9 @@ class PearcordPlatform extends EventEmitter {
|
||||
channelId: this.activeChannelId,
|
||||
messageId
|
||||
})
|
||||
const pinRows = await this.db.find(COLLECTIONS.PINS, { channelId: this.activeChannelId })
|
||||
this.emit('pin', { channelId: this.activeChannelId, messageId, removed: true })
|
||||
span.end({ channelId: this.activeChannelId, guildId })
|
||||
span.end({ channelId: this.activeChannelId, guildId, messageId, pinCount: pinRows.length })
|
||||
} catch (err) {
|
||||
this.log.error('pin.unpin error', {
|
||||
messageId,
|
||||
|
||||
Reference in New Issue
Block a user