Skip to content
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

feat(premeeting): pre-call connection test #15151

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andrei-gavrilescu
Copy link
Contributor

@andrei-gavrilescu andrei-gavrilescu commented Sep 25, 2024

Adds the possibility of enabling a pre-call test to run on the pre-meeting screen. Depends on jitsi/lib-jitsi-meet#2578
Screenshots of how this looks:


Screenshot 2024-09-25 at 10 36 44
Screenshot 2024-09-25 at 10 37 55
Screenshot 2024-09-25 at 10 38 29
Screenshot 2024-09-25 at 10 39 29

Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Left some comments, PTAL! Was this ever implemented on mobile?

config.js Outdated
@@ -1148,6 +1148,12 @@ var config = {
// This would also require to configure watchRTCConfigParams.
// Please remember to keep rtcstatsEnabled disabled for watchRTC to work.
// watchRTCEnabled: false,

// Configuration for pre-call test
Copy link
Member

Choose a reason for hiding this comment

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

Since this happens in the pre-join screen, I think we should move it to the prejoinConfig section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved

config.js Outdated
// By setting preCallTestEnabled, you enable the pre-call test in the prejoin page.
// ICE server credentials need to be provided over the preCallTestICEUrl
// preCallTestEnabled: false,
// preCallTestICEUrl: ''
Copy link
Member

Choose a reason for hiding this comment

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

This should likely not be whitelisted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk, the discussion was to not have this enabled by default, just some clients

lang/main.json Outdated
@@ -933,6 +935,7 @@
"goodQuality": "Awesome! Your media quality is going to be great.",
"noMediaConnectivity": "We could not find a way to establish media connectivity for this test. This is typically caused by a firewall or NAT.",
"noVideo": "We expect that your video will be terrible.",
"testFailed": "The connection test encountered unexpected issues, but this might not impact your experience",
Copy link
Member

Choose a reason for hiding this comment

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

Should this sentence end in a period?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, added


dispatch(setPreCallTestResults({ status: PreCallTestStatus.RUNNING }));

const turnCredentialsUrl = getPreCallICEUrl(getState());
Copy link
Member

Choose a reason for hiding this comment

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

Why not check this before even starting the check, and skip it entirely, with a warning log line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason is that I wanted to handle this state the same as an error state so it's only handled in a single place, that being the catch at the end here. A log line is still going to get printed just as an error.
If I were to move this somewhere else I'd have to add another state and complicate the logic a bit, this felt cleaner.

throw new Error('No TURN credentials URL provided in config');
}

const turnCredentials = await fetch(turnCredentialsUrl);
Copy link
Member

Choose a reason for hiding this comment

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

Let's give the whole operation a timeout, in case there is a chance for something to get stuck.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The precall test lib already has a timeout mechanism, I think that's sufficient as it's pretty straight forward.
Plus the worse case scenario is that the precall test is just going to remain in a running state, the UX itself isn't going to be blocked, users can go on and join their meeting as normal.

@@ -145,10 +158,15 @@ const CONNECTION_TYPE_MAP: {
* @param {IProps} props - The props of the component.
* @returns {ReactElement}
*/
function ConnectionStatus({ connectionDetails, t, connectionType }: IProps) {
const ConnectionStatus = React.memo(({ connectionDetails, t, connectionType, _runPreCallTest }: IProps) => {
Copy link
Member

Choose a reason for hiding this comment

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

Why was memo applied here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The prejoin screen does a bunch of re-renders, this was just meant to prevent some on this component.
The component was refactored it to useSelector and useDispatch as requested on another comment, so this got removed.

color = { 'green' }
size = 'medium' />
</div>
<span>&nbsp;&nbsp;</span>
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider <hr /> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just meant to add a couple of spaces between the two, but it was just an artifact from testing and is not needed anymore, removed.

* runPreCallTest: Function
* }}
*/
function mapDispatchToProps(dispatch: IStore['dispatch']) {
Copy link
Member

Choose a reason for hiding this comment

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

Not a fan of mDP it's a lot of boilerplate for a function that's 1 line... can we avoid this pl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

avoided, switched to useSelector, and useDispatch

@@ -1,4 +1,10 @@
import { findIndex } from 'lodash';
Copy link
Member

Choose a reason for hiding this comment

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

Use lodash-es

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed.

throughput.audioQuality === 2
&& throughput.videoQuality === 2
&& loss.audioQuality === 2
&& loss.videoQuality === 3
Copy link
Member

Choose a reason for hiding this comment

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

Why is this 3 and not 2, or >= 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the intent here was something like "If video packet loss is not bellow 0.05%, it's not considered good quality".

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.

2 participants