feat(platform): extend role.create/reorder/member span metadata for Phase 571

Add guildCount to role.create/delete/reorder ends; role.member end now
includes spanKind, activeChannelId, assignedRoleCount, and customRoleCount.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 15:14:54 -04:00
co-authored by Cursor
parent 3a723c36da
commit 0dc7e72059
2 changed files with 21 additions and 4 deletions
+2
View File
@@ -181,6 +181,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
**v0.8.419 (Phase 456):** `session.startup` span ends with `guildCount` + `guildId`; `session.startup error` log. `identity.register` span + `identity.register error`. `guild.open` span end includes `guildId`. `loadGuild` / `createGuild` bust search cache and clear `_lastSearchFromCache`. Bundle: `npm run test:phase456-onboarding-session`. See [SESSION.md](../../docs/SESSION.md). **v0.8.419 (Phase 456):** `session.startup` span ends with `guildCount` + `guildId`; `session.startup error` log. `identity.register` span + `identity.register error`. `guild.open` span end includes `guildId`. `loadGuild` / `createGuild` bust search cache and clear `_lastSearchFromCache`. Bundle: `npm run test:phase456-onboarding-session`. See [SESSION.md](../../docs/SESSION.md).
**v0.8.534 (Phase 571):** Role spans extend — `guildCount` on `role.create`/`role.delete`/`role.reorder`; `role.member` `spanKind`/`activeChannelId`/`assignedRoleCount`/`customRoleCount`. UI `#roles-hub-panel-live` + `syncRolesHubLivePanelDuringGuildLoading`; **role-errors** excludes permission bleed; clipboard `rolesHubPanelLiveBusy`/`rolesReorderChromeBusy`/`channelCustomRoleCount`. Bundle: `npm run test:phase571-roles`. See [ROLES.md](../../docs/ROLES.md).
**v0.8.533 (Phase 570):** Permission spans extend — `role.update`/`permission.overwrite`/`permission.eval` `guildCount`; `permission.eval` `spanKind`/`activeChannelId`. UI `#permissions-panel-live` + `syncPermissionsLivePanelDuringGuildLoading`; **permission-errors**/**role-errors** exclude session/settings/invite bleed; clipboard `permissionsPanelLiveBusy`/`permissionsRoleChromeBusy`/`channelPermissionOverwriteCount`. Bundle: `npm run test:phase570-permissions`. See [PERMISSIONS.md](../../docs/PERMISSIONS.md). **v0.8.533 (Phase 570):** Permission spans extend — `role.update`/`permission.overwrite`/`permission.eval` `guildCount`; `permission.eval` `spanKind`/`activeChannelId`. UI `#permissions-panel-live` + `syncPermissionsLivePanelDuringGuildLoading`; **permission-errors**/**role-errors** exclude session/settings/invite bleed; clipboard `permissionsPanelLiveBusy`/`permissionsRoleChromeBusy`/`channelPermissionOverwriteCount`. Bundle: `npm run test:phase570-permissions`. See [PERMISSIONS.md](../../docs/PERMISSIONS.md).
**v0.8.532 (Phase 569):** Session spans extend — `session.startup` `spanKind`/`activeChannelId`; `guild.open` `memberCount`/`guildCount`/`channelCount`/`spanKind`. UI `#session-panel-live` + `syncSessionLivePanelDuringGuildLoading`; **session-errors** excludes settings/invite bleed; clipboard `sessionPanelLiveBusy`/`sessionBootChromeBusy`/`channelSessionGuildCount`. Bundle: `npm run test:phase569-session`. See [SESSION.md](../../docs/SESSION.md). **v0.8.532 (Phase 569):** Session spans extend — `session.startup` `spanKind`/`activeChannelId`; `guild.open` `memberCount`/`guildCount`/`channelCount`/`spanKind`. UI `#session-panel-live` + `syncSessionLivePanelDuringGuildLoading`; **session-errors** excludes settings/invite bleed; clipboard `sessionPanelLiveBusy`/`sessionBootChromeBusy`/`channelSessionGuildCount`. Bundle: `npm run test:phase569-session`. See [SESSION.md](../../docs/SESSION.md).
+19 -4
View File
@@ -5404,7 +5404,8 @@ class PearcordPlatform extends EventEmitter {
nameLen: String(name || '').trim().length, nameLen: String(name || '').trim().length,
spanKind: 'role.create', spanKind: 'role.create',
activeChannelId: this.activeChannelId, activeChannelId: this.activeChannelId,
customRoleCount: customRoles.length customRoleCount: customRoles.length,
guildCount: (this.guilds || []).length
}) })
return row return row
} catch (err) { } catch (err) {
@@ -5486,7 +5487,8 @@ class PearcordPlatform extends EventEmitter {
existed: !!prev, existed: !!prev,
spanKind: 'role.delete', spanKind: 'role.delete',
activeChannelId: this.activeChannelId, activeChannelId: this.activeChannelId,
customRoleCount: customRoles.length customRoleCount: customRoles.length,
guildCount: (this.guilds || []).length
}) })
return prev return prev
} catch (err) { } catch (err) {
@@ -5514,13 +5516,16 @@ class PearcordPlatform extends EventEmitter {
if (row.updatedAt) this.guild.gossipRoleUpsert(row) if (row.updatedAt) this.guild.gossipRoleUpsert(row)
} }
this.emit('guild-role-reorder', { guildId: this.guild.guild.id, roleIds }) this.emit('guild-role-reorder', { guildId: this.guild.guild.id, roleIds })
const customRoles = await this.guildRoles.listRoles(this.guild.guild.id)
span.end({ span.end({
count: rows.length, count: rows.length,
guildId, guildId,
requested: (roleIds || []).length, requested: (roleIds || []).length,
spanKind: 'role.reorder', spanKind: 'role.reorder',
activeChannelId: this.activeChannelId, activeChannelId: this.activeChannelId,
reorderedAll: rows.length === (roleIds || []).length reorderedAll: rows.length === (roleIds || []).length,
customRoleCount: customRoles.length,
guildCount: (this.guilds || []).length
}) })
return rows return rows
} catch (err) { } catch (err) {
@@ -5558,7 +5563,17 @@ class PearcordPlatform extends EventEmitter {
guildId: this.guild.guild.id, guildId: this.guild.guild.id,
userId userId
})) }))
span.end({ userId, guildId, roleCount: (roleIds || []).length }) const customRoles = await this.guildRoles.listRoles(this.guild.guild.id)
span.end({
userId,
guildId,
roleCount: (roleIds || []).length,
assignedRoleCount: (roleIds || []).length,
spanKind: 'role.member',
activeChannelId: this.activeChannelId || null,
customRoleCount: customRoles.length,
guildCount: (this.guilds || []).length
})
return link return link
} catch (err) { } catch (err) {
this.log.error('role.member error', { this.log.error('role.member error', {