Skip to content

Room list: listen to call event to check number of participants#32677

Merged
florianduros merged 13 commits intodevelopfrom
florianduros/listen-call-partipants
Mar 2, 2026
Merged

Room list: listen to call event to check number of participants#32677
florianduros merged 13 commits intodevelopfrom
florianduros/listen-call-partipants

Conversation

@florianduros
Copy link
Member

@florianduros florianduros commented Mar 2, 2026

This PR makes the room list item to listen to CallEvent#Participants event to check the number of the participants and display the video icon if necessary.

Why is it needed?
In #32663, the EC tests are failing: https://e2e-32663--matrix-react-sdk.netlify.app/#?q=s%3Afailed:

When testing manually, the video icon is displayed however only because it's relying on the notification events. Notifications triggers a re-render, check the number of participants in the call and displays the icon.
Clearing the excessive re-renders makes the e2e failed because they don't fire a notification. The call state event is fired (0 participants in the room) and ... nothing, no event that a new participant has joined the call.

The room list needs to listen to `CallEvent.Participants` to be able to
display the Call icon. This was working before
#32663 due to an excessive
re-renders or relying on the notification events.
Copy link
Contributor

@toger5 toger5 left a comment

Choose a reason for hiding this comment

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

This looks sensible.
Thanks.

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.

I would like the CallStore to keep its pretty limited responsibilities — it should track which calls are in which rooms, and not a whole lot else. Adding more events kind of obscures its purpose.

Therefore if a consumer is interested in a call's metadata, they should subscribe to events directly on the relevant Call object as needed. This keeps the reactivity fine-grained and explicit. Does that make sense to you?

@toger5
Copy link
Contributor

toger5 commented Mar 2, 2026

I would like the CallStore to keep its pretty limited responsibilities — it should track which calls are in which rooms, and not a whole lot else. Adding more events kind of obscures its purpose.

Therefore if a consumer is interested in a call's metadata, they should subscribe to events directly on the relevant Call object as needed. This keeps the reactivity fine-grained and explicit. Does that make sense to you?

I can relate to this take. We will end up with a very large amount of subscriptions however.
since we would need to track each room manually and maybe even do so at numerous places in the UI dependent how we use it. Centralising "all call store" events (that we need for the room list) and all "call" events that we need when showing a more detailed call info page seems like a sensible architecture to me.

Overall I am wondering if we can simplify the EW code a lot by moving to js-sdk primitives like the matrixRtcSessionManger directly. (and also expose RTCSession instead of the wrapped Call model)

I do expect us to look into this eventually (probably when we consider changing the jitsi impl to also just be matrixRTC or when dropping legacy calls or making them matrixRTC complient as well) and then I would like to give this a very thorough evaluation how we want the call api to look like.

TLDR: I am okay with how it is done to reduce friction but robins approach is also the one I would like a little bit more. (A "little" because I am seeing a risk of misusing the api and ending up with a lot of subscriptions accidently)

@dbkr
Copy link
Member

dbkr commented Mar 2, 2026

I did wonder about this as it seemed a bit redundant for it to just pass the messages straight through, I concluded that maybe consistency is best if it's listening for some events from here, but I do still think it's a bit unnecessary.

@florianduros florianduros force-pushed the florianduros/listen-call-partipants branch from 7148dc7 to e03b718 Compare March 2, 2026 14:43
@florianduros florianduros force-pushed the florianduros/listen-call-partipants branch from e03b718 to 91cfdac Compare March 2, 2026 14:45
@florianduros florianduros changed the title Room list: listen to call store event to check number of participants Room list: listen to call event to check number of participants Mar 2, 2026

// Remove listener from previous call (if any) and add to new call to track participant changes
if (call !== this.currentCall) {
this.currentCall?.off(CallEvent.Participants, this.onCallParticipantsChanged);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really what we do when using trackListener?
Will the tracker be automatically be cleaned up? Or will we end up checking if for all manually off emitters if they are still connected and only call off in the dispose step on the ones still connected?

Copy link
Member Author

@florianduros florianduros Mar 2, 2026

Choose a reason for hiding this comment

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

The tracker cleans up the listeners when the view model is disposed. It's not tied to the lifecycle of the Call object

@florianduros florianduros enabled auto-merge March 2, 2026 17:11
@florianduros florianduros added this pull request to the merge queue Mar 2, 2026
Merged via the queue into develop with commit 15530ef Mar 2, 2026
42 checks passed
@florianduros florianduros deleted the florianduros/listen-call-partipants branch March 2, 2026 17:32
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Mar 10, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [vectorim/element-web](https://github.com/element-hq/element-web) | patch | `v1.12.11` → `v1.12.12` |

---

### Release Notes

<details>
<summary>element-hq/element-web (vectorim/element-web)</summary>

### [`v1.12.12`](https://github.com/element-hq/element-web/releases/tag/v1.12.12)

[Compare Source](element-hq/element-web@v1.12.11...v1.12.12)

#### ✨ Features

- Add stable support for MSC4380 invite blocking ([#&#8203;31966](element-hq/element-web#31966)). Contributed by [@&#8203;richvdh](https://github.com/richvdh).
- Hide the names of banned users behind a spoiler tag ([#&#8203;32424](element-hq/element-web#32424)). Contributed by [@&#8203;andybalaam](https://github.com/andybalaam).
- Room list: remove bold effect on selected room ([#&#8203;32593](element-hq/element-web#32593)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Use Compound buttons in auth screens ([#&#8203;32562](element-hq/element-web#32562)). Contributed by [@&#8203;t3chguy](https://github.com/t3chguy).
- Track room list sorting algorithm changes ([#&#8203;32556](element-hq/element-web#32556)). Contributed by [@&#8203;MidhunSureshR](https://github.com/MidhunSureshR).
- Update `sso_redirect_options` to work for Native OIDC ([#&#8203;32537](element-hq/element-web#32537)). Contributed by [@&#8203;t3chguy](https://github.com/t3chguy).

#### 🐛 Bug Fixes

- Room list: avoid excessive re-renders on room list store update or filter change ([#&#8203;32663](element-hq/element-web#32663)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Room list: listen to call event to check number of participants ([#&#8203;32677](element-hq/element-web#32677)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Fix invite-specific join errors not being shown ([#&#8203;32621](element-hq/element-web#32621)). Contributed by [@&#8203;Half-Shot](https://github.com/Half-Shot).
- Prevent logging lots of "Browser unsupported" lines ([#&#8203;32647](element-hq/element-web#32647)). Contributed by [@&#8203;Half-Shot](https://github.com/Half-Shot).
- Update critical gradient for room status bar ([#&#8203;32575](element-hq/element-web#32575)). Contributed by [@&#8203;Half-Shot](https://github.com/Half-Shot).
- Room list: avoid header overflowing when too long ([#&#8203;32645](element-hq/element-web#32645)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Room list: center focus outline of room list item ([#&#8203;32637](element-hq/element-web#32637)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Fix misaligned cross in complete security dialog ([#&#8203;32614](element-hq/element-web#32614)). Contributed by [@&#8203;dbkr](https://github.com/dbkr).
- Room list: fix keyboard navigation ([#&#8203;32585](element-hq/element-web#32585)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Don't show empty privacy section ([#&#8203;32582](element-hq/element-web#32582)). Contributed by [@&#8203;dbkr](https://github.com/dbkr).
- Disable room list image dragging ([#&#8203;32590](element-hq/element-web#32590)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).
- Update UserMenu theme toggle to use IconButton ([#&#8203;32591](element-hq/element-web#32591)). Contributed by [@&#8203;t3chguy](https://github.com/t3chguy).
- Room list: make room list item scales with large font size ([#&#8203;32523](element-hq/element-web#32523)). Contributed by [@&#8203;florianduros](https://github.com/florianduros).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4yIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYXV0b21lcmdlIiwiaW1hZ2UiXX0=-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/4596
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants