Skip to content

Conversation

@toger5
Copy link
Contributor

@toger5 toger5 commented Aug 25, 2025

This adds a new public behavior to the call view model that represents the current waiting state when this client initiated the call. This state is described in the doc comment:

/**
   * The current call pickup state of the call.
   *  - "ringing": The call is ringing on other devices in this room (This client should give audiovisual feedback that this is happening).
   *  - "unknown": The client has not yet sent the notification event. We don't know if it will because it first needs to send its own membership.
   *     Then we can conclude if we were the first one to join or not.
   *  - "timeout": No-one picked up in the defined time this call should be ringing on others devices.
   *     The call failed. If desired this can be used as a trigger to exit the call.
   *  - "success": Someone else joined. The call is in a normal state. Stop audiovisual feedback.
   *  - null: EC is configured to never show any waiting for answer state.
   */

It will be used by the view to render a "waiting" screen and play a "dialing/waiting sound" (not part of this PR)

It is missing any decline state which will be added in a seperate PR.

Signed-off-by: Timo K toger5@hotmail.de

@toger5 toger5 requested a review from a team as a code owner August 25, 2025 11:59
@toger5 toger5 requested a review from AndrewFerr August 25, 2025 11:59
Signed-off-by: Timo K <toger5@hotmail.de>
@toger5 toger5 force-pushed the toger5/waitForNotificationAnswer branch from 986402c to 1b85445 Compare August 25, 2025 12:11
@toger5 toger5 changed the title Add dialing/rining state to CallViewModel (waitForNotificationAnswer$) Add dialing/ringing state to CallViewModel (waitForNotificationAnswer$) Aug 25, 2025
@toger5 toger5 force-pushed the toger5/waitForNotificationAnswer branch from 1b85445 to 23de483 Compare August 25, 2025 12:14
toger5 added 2 commits August 25, 2025 14:24
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
@toger5 toger5 force-pushed the toger5/waitForNotificationAnswer branch from 23de483 to fb8de06 Compare August 25, 2025 12:31
@toger5 toger5 changed the title Add dialing/ringing state to CallViewModel (waitForNotificationAnswer$) Add dialing/ringing state to CallViewModel (callPickupState$) Aug 25, 2025
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
toger5 added 2 commits August 26, 2025 18:09
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
src/UrlParams.ts Outdated
* - play a sound that indicates that it is awaiting an answer
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
*/
shouldWaitForCallPickup: boolean;
Copy link
Member

@BillCarsonFr BillCarsonFr Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard to find a correct naming for that :/
If I get it right it is when I start a call that will ring on the other side. And we want like a phone call experience, it should show the other user avatar/name, should give a ringing feedback, and gave up after a timeput

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. A nitpick: we could simplify the name to waitForCallPickup. Or to clarify that the ringing is happening on the other side, perhaps waitForRemoteAnswer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit changing this to waitForCallPickup for now. If anyone has a preference for something else, let me know.

* This entails:
* - show ui that it is awaiting an answer
* - play a sound that indicates that it is awaiting an answer
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand that, what does this mean "expires on the recevievers side?" Like the receiver should send some expiration signal?? Or is it a local timeout for when to stop trying to call?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that it's a local timeout - we get to specify a duration when sending the calling event, so if we assume that the receiver respects it, we can use a local timer to approximate when their ringing stops and we should give up.

Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my initial review - still need to look at the newly added behaviors in more detail.

* This entails:
* - show ui that it is awaiting an answer
* - play a sound that indicates that it is awaiting an answer
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that it's a local timeout - we get to specify a duration when sending the calling event, so if we assume that the receiver respects it, we can use a local timer to approximate when their ringing stops and we should give up.

src/UrlParams.ts Outdated
* - play a sound that indicates that it is awaiting an answer
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
*/
shouldWaitForCallPickup: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. A nitpick: we could simplify the name to waitForCallPickup. Or to clarify that the ringing is happening on the other side, perhaps waitForRemoteAnswer.

Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new behaviors look correct, though I'd like to try my hand at rewriting them into a slightly more idiomatic RxJS style. Some notes on the tests as well.

Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Timo is out, I fixed up my own comments. @BillCarsonFr Would you like to review again, or do we just consider this done?

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can clarify the behavior change on the raise hand test

@robintown robintown enabled auto-merge September 5, 2025 12:07
@robintown robintown merged commit 7961bb3 into livekit Sep 5, 2025
19 checks passed
@toger5 toger5 added the PR-Improvement Release note category. A PR that improves EC's performance or stability. label Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Improvement Release note category. A PR that improves EC's performance or stability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants