-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Simple refactor for skipLobby #30848
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
Conversation
| room_id: roomId, | ||
| view_call: true, | ||
| skipLobby: "shiftKey" in ev ? ev.shiftKey : false, | ||
| skipLobby: ("shiftKey" in ev && ev.shiftKey) || undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critically this means we only skipLobby when shiftKey is held, otherwise we follow defaults.
| <CallView | ||
| room={this.state.room} | ||
| resizing={this.state.resizing} | ||
| skipLobby={this.context.roomViewStore.skipCallLobby() ?? false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skipLobby is now a parameter on ElementCall.start, so it doesn't need to appear in any of the views :- all entrypoints eventually call the same logic in RoomViewStore
| // Immediately start the call. This will connect to all required widget events | ||
| // and allow the widget to show the lobby. | ||
| if (call.connectionState === ConnectionState.Disconnected) call.start(); | ||
| if (call.connectionState === ConnectionState.Disconnected) call.start({ skipLobby: payload.skipLobby }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every time a user in Element switches to a call, this section will be reached. It's therefore fine to pass through user-controlled parameters through start and a whole lot cleaner too.
| expect(cleanSpy).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("updates the call's skipLobby parameter", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer handled here. The playwright tests cover this sufficiently.
Replaces #30833
This is a much simpler solution to achieve the same goal; we want to include skipLobby after user interaction to ensure the call starts in the correct state, but critically we also want to unset the value if the user doesn't provide a preference to allow Element Call to determine the correct state.
Rather than trying to unpick preloading of widgets, for now we just regenerate the URL shortly before
start()ing the call which hopefully ensures it gets the correct state.Checklist
public/exportedsymbols have accurate TSDoc documentation.