-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
events with 0 duration dose not contribute to next day calculation #1099
Conversation
WalkthroughSeveral modifications were made to improve the calculation of gaps over midnight and event durations in the Changes
Sequence Diagram(s)sequenceDiagram
participant RundownService
participant DateUtils
RundownService->>DateUtils: checkIsNextDay(previousStart, timeStart, previousDuration)
alt previousDuration is 0
DateUtils-->>RundownService: return false
else
alt timeStart is after previousStart
DateUtils-->>RundownService: return true
else
DateUtils-->>RundownService: return false
end
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
apps/server/src/services/rundown-service/__tests__/rundownCache.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff, we just clarify the test name and are good to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- apps/server/src/services/rundown-service/tests/rundownCache.test.ts (1 hunks)
- apps/server/src/services/rundown-service/rundownCache.ts (3 hunks)
- packages/utils/src/date-utils/checkIsNextDay.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/server/src/services/rundown-service/tests/rundownCache.test.ts
Additional comments not posted (3)
packages/utils/src/date-utils/checkIsNextDay.ts (1)
11-12
: Logic correctly updated to handle zero duration events.The update to
checkIsNextDay
correctly implements the new logic to prevent next day transition whenpreviousDuration
is zero. This change aligns well with the PR's objective.apps/server/src/services/rundown-service/rundownCache.ts (2)
90-90
: Proper initialization ofpreviousDuration
.The variable
previousDuration
is initialized tonull
, which is appropriate for its use in tracking the duration of previous events.
116-116
: Correct use ofpreviousDuration
in event gap calculations.The
previousDuration
variable is effectively utilized to assess event transitions over midnight, enhancing the accuracy of the day span calculation.Also applies to: 139-139
Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/server/src/services/rundown-service/tests/rundownCache.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/server/src/services/rundown-service/tests/rundownCache.test.ts
No description provided.