Include OWN_CAPABILITIES data in websocket message for users in call.member_added

Open
#1,890 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start in the @stream-io/video-react-sdk handling for the call.member_added websocket event and the useHasPermissions hook. Trace how OWN_CAPABILITIES is received and stored, then verify that a newly added client user causes the join/leave UI state to update without an extra call.get(); add or update relevant tests if the package has coverage for this event.

Written by the indexing model from the issue text.

Description

enhancement

Which package/packages do you use?

  • @stream-io/video-react-sdk
  • @stream-io/video-react-native-sdk
  • @stream-io/video-client

Is your feature request related to a problem? Please describe.
Hosts dynaically add and remove call members and using a waiting room system.
When I add a call member the newly added call user receives the 'call.member_added' event message via the websocket.
But I also have to execute call.get() to refresh OWN_CAPABILITIES of the user to test that the user can now join a call to refresh the UI 'Join/Leave' button.
I utilise 'useHasPermissions' hook and this is stale until I execute call.get(), which I am now doing on 'call.member_*' events if event.members has client user reference.

Describe the solution you'd like
When sending call.member_added WS message include OWN_CAPABILITIES if the user is the client user, and
refresh the internal state of the call.
Maybe this triggers a useHasPermissions re-render, or you implement a new useOwnCapabilities() hook that triggers on change.

Describe alternatives you've considered

Additional context

Image
Dominant language
TypeScript
Stars
125
Forks
49
Avg merge
1d 4h
Merged PRs (30d)
82

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GetStream/stream-video-js

All issues in GetStream/stream-video-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.