Skip to content
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

Allow multiple calls at the same time #94

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

hopperelec
Copy link
Contributor

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.

@github-actions
Copy link

github-actions bot commented Oct 25, 2023

⚡ Preview for this PR: https://pr-94.chat-analytics.pages.dev
📊 Demo

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

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 ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
- Coverage   71.96%   71.90%   -0.06%     
==========================================
  Files          60       60              
  Lines        2440     2442       +2     
  Branches      513      513              
==========================================
  Hits         1756     1756              
- Misses        624      626       +2     
  Partials       60       60              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mlomb
Copy link
Owner

mlomb commented Nov 22, 2023

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)

@mlomb mlomb merged commit 90ad151 into mlomb:main Nov 22, 2023
9 checks passed
@hopperelec
Copy link
Contributor Author

hopperelec commented Nov 22, 2023

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

mlomb added a commit that referenced this pull request Nov 22, 2023
@mlomb
Copy link
Owner

mlomb commented Nov 22, 2023

You are right, my bad. Fixed in 6b1be2b

@hopperelec hopperelec deleted the multiCallSameTime branch November 22, 2023 21:17
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.

2 participants