-
Notifications
You must be signed in to change notification settings - Fork 136
Reset overwrite url if it is invalid (does fail to reach sfu) #3595
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
base: livekit
Are you sure you want to change the base?
Conversation
Half-Shot
left a comment
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.
We can do better UX here.
8348e94 to
4148a05
Compare
7db6d1c to
ed45177
Compare
08219fe to
5ceb140
Compare
|
@Half-Shot I updated this PR so it now checks before setting the value. |
| } | ||
|
|
||
| try { | ||
| logger.debug("try setting"); |
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.
Assume all these debug logs will go before merge?
| customLivekitUrlTextBuffer === null | ||
| ) { | ||
| setCustomLivekitUrl(null); | ||
| return Promise.resolve(); |
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.
Do we need to return an explicit resolve in an async function?
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.
At the time I did not have the async call below this was needed i suspect ;) thanks for catching it.
| await getSFUConfigWithOpenID( | ||
| client, | ||
| customLivekitUrlTextBuffer, | ||
| "Test-room-alias-" + Date.now().toString() + client.getUserId(), |
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.
| "Test-room-alias-" + Date.now().toString() + client.getUserId(), | |
| `Test-room-alias-${Date.now()}${client.getUserId()}`, |
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.
What's the room alias thing about, btw?
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.
This can be any id lk should use. But I am not sure the jwt service will use it for checking if we are part of the room. its saver to set this to the actual roomId.
| } catch (e) { | ||
| logger.error("failed setting", e); | ||
| setCustomLivekitUrlUpdateError("invalid URL (did not update)"); | ||
| // automatically unset the error after 4 seconds (2 seconds will be for the save label) |
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.
This seems like an unusual thing to do? Usually inputs change the error state when the value changes, 4 seconds isn't even enough time to understand the error.
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.
Also, since you're not cancelling the timeout, you'll have these stack up if you try to save within that 2 second window.
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.
think it should be fine to just show the error until the user has actually entered sth reasonable.
I was worried it might be confusing what is actually set right now if the control shows an error. But probably users will change it until they have set it to sth that works.
The overwrite option currently can brick your element call and you need to update the local store manually. This PR automatically resets the overwrite url if it errored once while trying to get the livekit focus. (auto fallback to nen dev overwrite)