Skip to content

Fix Assistant profile heartbeat timestamp precision - #225

Merged
kinqsradio merged 1 commit into
mainfrom
fix/profile-heartbeat-precision
Oct 22, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/profile-heartbeat-precision

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Summary

Fix the Assistant profile heartbeat regression uncovered while verifying main after #222 and #223 merged.

PostgreSQL timestamps retain microseconds; node-postgres converts timestamp results to millisecond Date values. Passing that rounded observation back to SQL can incorrectly classify a heartbeat at the same database instant as being in the future. Keep the database observation as timestamp text for heartbeat and lease comparisons, while using Date for calendar and display work. The 30-second freshness window and future-heartbeat rejection remain intact.

Add a real-database regression that pins a heartbeat and observation to the same transaction instant with nonzero microseconds. It also verifies a future heartbeat remains unavailable. Transaction rollback restores heartbeat fixtures.

Evidence

  • New regression failed before the fix: expected [true, false], received [false, false].
  • Full profile suite passes 10/10 after the fix.
  • Backend TypeScript and scoped formatting/whitespace checks pass.
  • Work performed in an isolated checkout from main; no concurrent skills or policy edits included.

Context

Main CI first encountered an unrelated Chromium Target.createTarget timeout in an unchanged Gantt test. Its rerun exposed this precision issue. Full remote CI will qualify the corrected main commit; this PR does not weaken or skip either test.

@kinqsradio
kinqsradio merged commit 9992616 into main Oct 22, 2026
5 checks passed
@kinqsradio
kinqsradio deleted the fix/profile-heartbeat-precision branch November 2, 2026 07:56
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