Closed hopperelec closed 11 months ago
⚡ Preview for this PR: https://pr-94.chat-analytics.pages.dev 📊 Demo
Attention: 4 lines
in your changes are missing coverage. Please review.
Comparison is base (
33696f2
) 71.96% compared to head (3d7a8af
) 71.90%.
Files | Patch % | Lines |
---|---|---|
pipeline/aggregate/blocks/calls/CallsStats.ts | 0.00% | 3 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
You are right, but I think the sign is flipped. We want to ignore the overlap time, so we have to subtract the difference (since this line secondsInCall += call.duration
will count the overlap twice)
Yes, you want to take off the absolute difference if the difference is negative, but since the difference is negative (hence the if (diff < 0) {
) this actually means adding it.
For example, if the second call is 10 seconds before the first one, then diff
could be -10
and we want to take off the 10 seconds in between. If we do secondsInCall -= -10
, we actually add 10
You are right, my bad. Fixed in https://github.com/mlomb/chat-analytics/commit/6b1be2b6e1cd93242f5568d859bdd4f6ef575d82
It's usually safe to assume that a call cannot be started when the last one hasn't ended yet, but this doesn't work if importing multiple chats. I could be in a call with someone but receive a call from someone else, or I could be in two group chats which happened to have an active call at the same time.