Skip to content

Fix: Fix debug log sessions appearing in wrong order#436

Merged
d4rken merged 1 commit intomainfrom
fix/debug-session-timestamp-format
Mar 9, 2026
Merged

Fix: Fix debug log sessions appearing in wrong order#436
d4rken merged 1 commit intomainfrom
fix/debug-session-timestamp-format

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 9, 2026

What changed

Fixed debug log sessions sometimes appearing in the wrong order. Also changed the session directory naming to use a human-readable UTC timestamp (e.g. 20231114T221320Z) instead of raw milliseconds, making it easier to identify sessions when browsing files.

Technical Context

  • Root cause: parseCreatedAt read filesystem creation time attributes, which differ between sequentially created directories. When two sessions shared the same logical timestamp, the sort tiebreaker (by ID) never kicked in because filesystem times were never truly equal.
  • Fix: parse the timestamp from the directory name (capod_{version}_{yyyyMMddTHHmmssZ}_{suffix}) instead of querying filesystem attributes. Falls back to filesystem attributes for non-standard filenames.
  • The human-readable format (yyyyMMdd'T'HHmmss'Z') was chosen over epoch millis for debuggability — no backward compat concern since the feature hasn't been released yet.

…ry names

Parse creation time from the embedded filename timestamp instead of relying on filesystem attributes, which are non-deterministic and caused flaky test failures in CI.
@d4rken d4rken added the bug Something isn't working label Mar 9, 2026
@d4rken d4rken merged commit de89c51 into main Mar 9, 2026
9 checks passed
@d4rken d4rken deleted the fix/debug-session-timestamp-format branch March 9, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant