Skip to content

Fix timer session rounding#184

Closed
cb341 wants to merge 4 commits into
mainfrom
fix/19656-timer-session-overlap
Closed

Fix timer session rounding#184
cb341 wants to merge 4 commits into
mainfrom
fix/19656-timer-session-overlap

Conversation

@cb341
Copy link
Copy Markdown
Contributor

@cb341 cb341 commented Jun 30, 2025

TICKET-19656

The order of the before save hooks was incorrect.
Also there was an error within the #round_timer_to_nearest_minute method.

After some manual testing, I could not reproduce the overlaps.

@cb341 cb341 requested a review from schmijos June 30, 2025 07:25
@cb341 cb341 self-assigned this Jun 30, 2025
@cb341 cb341 force-pushed the fix/19656-timer-session-overlap branch from dce155f to d988745 Compare June 30, 2025 07:34
@cb341 cb341 marked this pull request as ready for review June 30, 2025 07:39
@cb341 cb341 force-pushed the fix/19656-timer-session-overlap branch from bb1d5cf to bf9cbdc Compare June 30, 2025 07:39
end

test 'round_timer_to_nearest_minute' do
@timer_session.timer_end = nil
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
@timer_session.timer_end = nil

Comment on lines +112 to +113
timer_session = FactoryBot.build(:timer_session, user: User.current, finished: false)
timer_session.timer_end = nil
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
timer_session = FactoryBot.build(:timer_session, user: User.current, finished: false)
timer_session.timer_end = nil
timer_session = FactoryBot.build(:timer_session, user: User.current, finished: false, timer_end: nil)


test 'round_timer_to_nearest_minute' do
@timer_session.timer_end = nil
timer_start_before = @timer_session.timer_start
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hardcode seconds in the spec

@schmijos schmijos removed their request for review July 1, 2025 07:43
@cb341 cb341 closed this Aug 29, 2025
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