Skip to content

Fix request audit log ordering#3459

Open
shubhamsinnh wants to merge 1 commit into
fosrl:devfrom
shubhamsinnh:codex/fix-request-log-ordering
Open

Fix request audit log ordering#3459
shubhamsinnh wants to merge 1 commit into
fosrl:devfrom
shubhamsinnh:codex/fix-request-log-ordering

Conversation

@shubhamsinnh

@shubhamsinnh shubhamsinnh commented Jul 19, 2026

Copy link
Copy Markdown

Summary

  • Add a deterministic secondary sort for request audit logs when multiple entries share the same timestamp.
  • Stop rendering generated sample rows in audit log tables while real log data is loading.

Why

Request audit log entries store timestamps at second-level precision. Under high activity, many entries can share the same timestamp. The request log query sorted only by timestamp, so separate executions for the GUI and CSV export could return same-timestamp rows in different orders. That can make row-by-row comparisons look like the GUI mixed data even when each individual row is valid.

Request logs now sort by timestamp descending and then id descending, matching the deterministic ordering pattern already used by action, access, and connection audit log queries.

Audit log pages also now render only real API data instead of generated placeholder rows while loading.

Fixes #3458.

Validation

  • git diff --check HEAD~1 HEAD
  • npx prettier --check server/routers/auditLogs/queryRequestAuditLog.ts 'src/app/[orgId]/settings/logs/access/page.tsx' 'src/app/[orgId]/settings/logs/action/page.tsx' 'src/app/[orgId]/settings/logs/connection/page.tsx' 'src/app/[orgId]/settings/logs/request/page.tsx'
  • npx tsc --noEmit --pretty false
  • Inserted a local burst of 50 same-timestamp request audit rows to verify the high-activity shape, then removed the synthetic rows afterward.

@shubhamsinnh
shubhamsinnh marked this pull request as ready for review July 19, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant