Skip to content

fix: on-call time inflated monthly hours and vanished from On-Call tab - #42

Merged
wiseelf merged 1 commit into
mainfrom
fix/oncall-hours-double-count
Jul 30, 2026
Merged

fix: on-call time inflated monthly hours and vanished from On-Call tab#42
wiseelf merged 1 commit into
mainfrom
fix/oncall-hours-double-count

Conversation

@wiseelf

@wiseelf wiseelf commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stats' monthly/weekly hours total and average summed all sessions, including on-call-active ones, inflating "usual hours" by the on-call portion (e.g. 185h53m instead of 184h). Now excludes on-call time, matching the income calc's existing filter. The on-call portion renders as an appended orange bar segment instead of an overlapping overlay.
  • OnCallBilling.activeMinutesWithinBillable only counted on-call-active time that fell inside a scheduled rotation window, so an ad hoc escalation outside any scheduled on-call shift was silently dropped — invisible in the On-Call tab and not eligible for active-rate income. Renamed to activeMinutes and reworked to count on-call-active time regardless of schedule, still excluding overlap with normal working hours (non-billable rules).

Also fixed a couple of related issues so days consisting only of on-call time are still tappable in the Stats bar chart (previously the tap/chevron were gated on regular hours only).

Test plan

  • swift test — 66 tests pass, including new cases for unscheduled escalations (activeMinutes_unscheduledEscalationCountsInFull, activeMinutes_unscheduledEscalationExcludesNonBillableOverlap)
  • swift build — clean build
  • Smoke-launched the built binary to confirm no runtime crash

…ations

Stats' period total/average summed all sessions including on-call-active
ones, inflating monthly "usual hours" by the on-call portion. It now
excludes on-call time, matching the income calc's existing behavior.

OnCallBilling.activeMinutesWithinBillable required on-call-active time to
fall inside a scheduled rotation window to count, so ad hoc escalations
outside the schedule were silently dropped from the On-Call tab. Renamed
to activeMinutes and reworked to count any on-call-active time (minus
overlap with non-billable working hours), regardless of schedule.
@wiseelf
wiseelf merged commit 14fed70 into main Jul 30, 2026
@wiseelf
wiseelf deleted the fix/oncall-hours-double-count branch July 30, 2026 10:19
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