fix(resource): pause/resume audit rows invisible in dashboard AuditPanel#270
Merged
Merged
Conversation
The resource.paused / resource.resumed audit events set only the ResourceID column, not metadata.resource_id. The dashboard per-resource AuditPanel (instanode-web fetchResourceAudit) filters the team audit window client-side by metadata.resource_id, and the JSON serializer (auditEventToMap) surfaces ONLY the JSONB metadata — the ResourceID column is never echoed onto the wire. Result: a resource's two most important state-change events were invisible in its Audit tab even though the rows existed. Add resource_id (+ resource_type) to both emit sites, matching the existing convention in emitResourceReadAudit and emitBackupAudit. Also restores the server-side resource-ownership OR branch in ListAuditEventsForCustomerExport, which keys on metadata->>'resource_id' for cross-actor events on a team's resource. Regression guards: TestPauseResource_EmitsMetadataResourceID + TestResumeResource_EmitsMetadataResourceID assert the row's metadata.resource_id equals the resource UUID (verified to fail without the fix). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug (pause/resume class — user-facing, currently shipping)
resource.paused/resource.resumedaudit events set only theResourceIDcolumn, not
metadata.resource_id.instanode-webfetchResourceAudit) filters the team audit window client-side bymetadata.resource_id === resource.id.auditEventToMapsurfaces only the JSONBmetadata— theResourceIDcolumn is never echoed onto the wire.Net effect: a resource's two most important state-change events (pause, resume)
never appeared in its Audit tab, even though the audit rows existed. Every
other resource-scoped event (
resource.read,connection_url.decrypted,backup.requested) already setsmetadata.resource_id; pause/resume were theonly two that didn't.
Coverage block
Fix
Add
resource_id(+resource_type) to both emit sites, matching the existingconvention in
emitResourceReadAudit/emitBackupAudit. This also restoresthe server-side resource-ownership OR branch in
ListAuditEventsForCustomerExport, which keys onmetadata->>'resource_id'for cross-actor events.
Additive metadata only — no contract break. New tests pass; verified they fail
without the fix.
🤖 Generated with Claude Code