Skip to content

Fix missing time boundary guard in TestJumpToDateEndpoint - #917

Merged
kegsay merged 3 commits into
mainfrom
kegan/timestamp-to-event-fix
Sep 9, 2026
Merged

Fix missing time boundary guard in TestJumpToDateEndpoint#917
kegsay merged 3 commits into
mainfrom
kegan/timestamp-to-event-fix

Conversation

@kegsay

@kegsay kegsay commented Sep 7, 2026

Copy link
Copy Markdown
Member

Whilst #872 tried to fix this, the review process reintroduced the bug for one specific scenario: when the initial room creation events are in the same millisecond as the event "before A". Without this extra sleep, timeBeforeEventA may actually be the "time exactly at the last initial creation events" which is Bad since it then messes up which events get returned.

Pull Request Checklist

@kegsay
kegsay requested review from a team as code owners September 7, 2026 13:15
@kegsay
kegsay requested review from MadLittleMods and removed request for a team September 7, 2026 13:15
Comment thread tests/room_timestamp_to_event_test.go Outdated
Comment on lines 365 to 367
time.Sleep(tsBoundaryGuard) // ensure timeBeforeEventA is AFTER the initial creation events
timeBeforeEventA := time.Now()
time.Sleep(tsBoundaryGuard)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix regression introduced in #872

This isn't a regression.

Whilst #872 tried to fix this, the review process reintroduced the bug for one specific scenario

I specifically pointed this out in review #872 (comment) but it was never addressed and you approved/merged the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This was resolved but the PR title/description was never updated.

I've just made some light touches 🤷

Comment thread tests/room_timestamp_to_event_test.go Outdated
@kegsay
kegsay merged commit d827c92 into main Sep 9, 2026
6 checks passed
@kegsay
kegsay deleted the kegan/timestamp-to-event-fix branch September 9, 2026 09:29
@MadLittleMods MadLittleMods changed the title Fix regression introduced in #872 Fix missing time boundary guard in TestJumpToDateEndpoint Sep 9, 2026
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.

3 participants