Skip to content

[v18] fix: out of sequence audit logs for same timestamp logs#63613

Merged
nibrasohin merged 1 commit intobranch/v18from
ohin/fix-sorting-for-audit-logs/v18
Feb 12, 2026
Merged

[v18] fix: out of sequence audit logs for same timestamp logs#63613
nibrasohin merged 1 commit intobranch/v18from
ohin/fix-sorting-for-audit-logs/v18

Conversation

@nibrasohin
Copy link
Contributor

@nibrasohin nibrasohin commented Feb 6, 2026

What Changed

Added manual sorting to sort audit logs by event index only when the log timestamp is the same. This fixes the issue where in some cases MCP Session Started audit logs where being displayed after MCP Session Request which should be the other way round, more details in the issue attached.

Automated Testing

Added a test to show that now when multiple events have the same timestamp we use the event index for sorting.
Also added a sanity test case to validate existing behaviour of sorting by timestamp.

Manual Testing Done

Manually rendered the audit page and validated that the existing sorting behaviour is not broken.
It is hard to generate two audit logs at the exact same timestamp so used tdd to validate when timestamps are same the bug is reproducible.

Related Issue

#58322

Changelog

changelog: Fixed out of sequent audit logs rendering in ui for same timestamp logs

message: formatter.format(json as any),
id: getId(json),
code: json.code,
eventIndex: json.ei,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of exposing it here I could use raw.ei in downstream, but validated that the ei is available for other event types also so decided to expose it formally, but open to using the raw event if there is a good reason for it.

@nibrasohin nibrasohin force-pushed the ohin/fix-sorting-for-audit-logs/v18 branch 2 times, most recently from b821771 to 061fd16 Compare February 6, 2026 22:17
@nibrasohin nibrasohin force-pushed the ohin/fix-sorting-for-audit-logs/v18 branch from 061fd16 to 8b2bd5e Compare February 6, 2026 22:18
@nibrasohin nibrasohin marked this pull request as ready for review February 6, 2026 22:25
@github-actions github-actions bot requested review from alexhemard and avatus February 6, 2026 22:25
@nibrasohin nibrasohin added no-changelog Indicates that a PR does not require a changelog entry and removed no-changelog Indicates that a PR does not require a changelog entry labels Feb 6, 2026
@greedy52 greedy52 self-requested a review February 11, 2026 21:02
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from alexhemard February 12, 2026 01:58
@nibrasohin nibrasohin added this pull request to the merge queue Feb 12, 2026
Merged via the queue into branch/v18 with commit 992e16e Feb 12, 2026
42 of 43 checks passed
@nibrasohin nibrasohin deleted the ohin/fix-sorting-for-audit-logs/v18 branch February 12, 2026 15:51
@doggydogworld doggydogworld mentioned this pull request Feb 13, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 18, 2026
#63819)

* fix: out of sequence audit logs for same timestamp logs (#63613)

* chore: updated unit tests as mcp is not supported in v17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments