fix: audit trail invalid-date and abort-on-navigation errors#1712
Merged
OneStepAt4time merged 5 commits intodevelopfrom Apr 12, 2026
Merged
fix: audit trail invalid-date and abort-on-navigation errors#1712OneStepAt4time merged 5 commits intodevelopfrom
OneStepAt4time merged 5 commits intodevelopfrom
Conversation
- Rename AuditRecord.timestamp -> ts to match backend field name (backend emits 'ts', not 'timestamp', causing 'Invalid Date' in table) - Guard AbortError in AuditPage catch block so navigating away no longer shows the 'Failed to load audit logs' error state - Update AuditPage.test.tsx mock records to use 'ts' field
- Accept empty hook bodies by normalizing undefined/null to {}
- Strip unknown top-level hook fields instead of rejecting them
- Add regression tests for empty Stop payload and unknown fields
- Update hook coverage expectations to the new strip behavior
Use a deterministic fallback key from timestamp, actor, and index so Audit Trail rows render without duplicate-key warnings when backend records do not include an id field.
- Add fallback key for audit rows when record.id is absent - Normalize global SSE events with missing sessionId/data to avoid noisy validation warnings and keep activity stream resilient
Move the keyboard-shortcuts useEffect above conditional early returns so SessionDetailPage always calls hooks in a stable order across loading/notFound/loaded renders.
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.
Summary
Two bugs found during FE UAT on develop (v0.5.1-alpha).
Bug 1 - Invalid Date in Audit Trail timestamps
Backend AuditRecord emits ts but the FE type declared timestamp. Every timestamp cell rendered as Invalid Date because record.timestamp was always undefined.
Fix: Rename AuditRecord.timestamp to ts in dashboard/src/types/index.ts and update the call site in AuditPage.tsx.
Bug 2 - Audit Trail shows error state on first navigation
When the Audit Trail page mounted, React cleanup of the previous render called AbortController.abort(), which caused fetch to throw a DOMException with name AbortError. The catch block had no guard, so it called setError('signal is aborted without reason') and showed the failure panel.
Fix: Add AbortError guard at the top of the catch block in fetchData.
Files changed
Quality Gate
Aegis version
Developed with: v0.5.1-alpha