Skip to content

Conversation

@pierre-lehnen-rc
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc commented Sep 30, 2025

Proposed changes (including videos or screenshots)

On the next phase of the voip project, we'll be implementing several features that may need to identify the duration of a call or identify if the call was sucessfull or not. These features include the call history, message blocks and also statistics.

However, the current version doesn't save any data that can be used to calculate a call's duration or indicate if it was successful once it is over. This PR makes a simple change to make the data format more future-proof, so that this information won't be missing from old calls when the new features get implemented.

With this information being already available, it also makes it much easier to identify problems when looking at a call's data on the database.

Issue(s)

VAI-148

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • Calls now include timestamps for when they are accepted and when they become active.
    • Enhanced call status tracking provides clearer timelines in call details and history where shown.
    • More precise call lifecycle information improves visibility for users monitoring ongoing or recent calls.

@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2025

⚠️ No Changeset found

Latest commit: 99756a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 30, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Added two optional timestamp fields to IMediaCall (acceptedAt, activatedAt). Updated model methods to set these timestamps when accepting or activating a call, alongside existing state and expiration updates. No signature changes; surrounding logic and error handling unchanged.

Changes

Cohort / File(s) Summary
Core typings
packages/core-typings/src/mediaCalls/IMediaCall.ts
Added optional Date properties: acceptedAt?, activatedAt? with descriptive comments.
Models updates
packages/models/src/models/MediaCalls.ts
On accept and activate call updates, now include acceptedAt: new Date() and activatedAt: new Date() respectively, in addition to existing state and expiresAt updates. No method signature or control-flow changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant MediaCallsModel as Models.MediaCalls
  participant Store as Persistence

  rect rgba(200,230,255,0.25)
  note over Client,Store: Accept call flow (adds acceptedAt)
  Client->>MediaCallsModel: acceptCallById(callId, userId)
  MediaCallsModel->>Store: update(callId, { state: accepted, expiresAt, acceptedAt: now })
  Store-->>MediaCallsModel: ack
  MediaCallsModel-->>Client: result
  end

  rect rgba(220,255,220,0.25)
  note over Client,Store: Activate call flow (adds activatedAt)
  Client->>MediaCallsModel: activateCallById(callId, userId)
  MediaCallsModel->>Store: update(callId, { state: active, expiresAt, activatedAt: now })
  Store-->>MediaCallsModel: ack
  MediaCallsModel-->>Client: result
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • tassoevan
  • ggazzo

Poem

A hop and a timestamp—click, accept!
Another spring—activate, well kept.
Little ticks in burrow logs appear,
Calls now tell when bunnies drew near.
With whiskers twitching, I commit and cheer—
Time-stamped trails, crystal clear! 🐇⌚

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The current PR title states “regression: missing duration and success information for voice calls”, but the changeset adds acceptedAt and activatedAt timestamp fields to the IMediaCall interface and model methods rather than introducing direct duration or success properties, so the title does not accurately summarize the main change. Please update the title to reflect the addition of acceptedAt and activatedAt timestamps, for example “add acceptedAt and activatedAt timestamps to media call interface”, so it clearly summarizes the primary change.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/media-call-duration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pierre-lehnen-rc pierre-lehnen-rc added this to the 7.11.0 milestone Sep 30, 2025
@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review September 30, 2025 14:47
@pierre-lehnen-rc pierre-lehnen-rc requested a review from a team as a code owner September 30, 2025 14:47
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.39%. Comparing base (bf35a0b) to head (99756a4).
⚠️ Report is 10 commits behind head on release-7.11.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           release-7.11.0   #37100      +/-   ##
==================================================
- Coverage           67.39%   67.39%   -0.01%     
==================================================
  Files                3328     3330       +2     
  Lines              113341   113481     +140     
  Branches            20564    20605      +41     
==================================================
+ Hits                76387    76478      +91     
- Misses              34348    34396      +48     
- Partials             2606     2607       +1     
Flag Coverage Δ
e2e 57.30% <ø> (+0.01%) ⬆️
e2e-api 40.55% <ø> (+0.12%) ⬆️
unit 71.18% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan merged commit 8a0adda into release-7.11.0 Oct 3, 2025
73 of 75 checks passed
@tassoevan tassoevan deleted the fix/media-call-duration branch October 3, 2025 16:43
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.

3 participants