-
Notifications
You must be signed in to change notification settings - Fork 15k
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
fix: getUserMedia
duplicate permissions call
#36787
Conversation
737bbbc
to
2bade11
Compare
2bade11
to
5c591e1
Compare
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.
Odds on a test? This code seems a little bit awkward and easy to break during patch changes
@MarshallOfSound test added! |
5c591e1
to
e25e073
Compare
Release Notes Persisted
|
I have automatically backported this PR to "22-x-y", please check out #36873 |
I have automatically backported this PR to "23-x-y", please check out #36874 |
* fix: getUserMedia duplicate permissions call * test: add regression test
* fix: getUserMedia duplicate permissions call * test: add regression test
Description of Change
Closes #36629.
Refs #34895.
Fixes an issue where the
setPermissionRequestHandler
callback would be invoked twice when usingnavigator.getUserMedia(...)
. This was happening because we didn't fully short-circuit all of the permission checks inMediaStreamDevicesController
When a user calledgetUserMedia
, Electron first does its own permissions check throughRequestMediaAccessPermission
, which resulted in the first callback being invoked. Then, whenMediaStreamDevicesController::RequestPermissions
was called, it would fall down to this line which fell down toElectronPermissionManager::RequestPermissionsWithDetails
and resulted in the second callback being called. We need to take previously-approved status into account when callingwebrtc::MediaStreamDevicesController::RequestPermissions
in order to fix this.Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where the
setPermissionRequestHandler
callback would be invoked twice when usingnavigator.getUserMedia(...)
.