already granted notification permissions not detected if page in container tab
Categories
(Core :: Permission Manager, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr68 | --- | unaffected |
| firefox73 | --- | unaffected |
| firefox74 | --- | unaffected |
| firefox75 | + | verified |
People
(Reporter: aryx, Assigned: ehsan.akhgari)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Firefox 75.0a1 20200225094028 on Windows 8.1
Slack shows its own notification bar that one shall grant it permissions to show notifications despite already having granted it. Clicking the link to grant it doesn't show the notification prompt/doorhanger.
Steps to reproduce:
- Open https://mozilla.slack.com
- Try to grant notification permissions from inside the website.
If the issues cannot be reproduced with step 1 and 2, first ran an older Firefox Nightly and grant the notification permission with that before updating to an affected build.
Bisection points to bug 1614831 as being the cause.
Comment 1•6 years ago
|
||
Ehsan, from the symptoms described by people on Slack it feels like the Permissions API (or the whole content process) has issues getting the right permissions, while the parent can still correctly get and display them. Can you look into this issue? :)
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
[Tracking Requested - why for this release]: major web-facing regression
| Assignee | ||
Comment 3•6 years ago
|
||
It seems like the slack link doesn't work on my development machine because auth0 is somehow broken there. Better test case: https://mdn.mozillademos.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API$samples/Tag_example?revision=1606062
Updated•6 years ago
|
| Reporter | ||
Comment 4•6 years ago
|
||
The permissions work with the link from comment 3 here (not seeing a notification can also have different reasons, see e.g. bug 1337490).
| Reporter | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
When the bug happens we're coming from TransmitPermissionsForPrincipal() and calling EnsurePermissionsByKey("https://app.slack.com^userContextId=2", "https://app.slack.com"). Then we get to nsPermissionManager::GetPermissionsFromOriginOrKey() with that origin string (which has the user context ID not stripped)) and the origin comparison inside that function fails.
The fix is very simple, but writing a test for this took much longer than I hoped for. I'll submit the full patch tomorrow.
| Assignee | ||
Comment 6•6 years ago
|
||
I spent several hours trying to write a test for it which would fail without the fix and pass with it, and I think I'm going to give up now. The reason why it is so difficult to do so is that for this test to work we would need TransmitPermissionsAndBlobURLsForPrincipalInfo() to be the first caller to ContentParent::TransmitPermissionsForPrincipal() after the content process has been launched such that we get around this cache.
I burned way too much time trying to create a test for this in order to replicate this exact condition as a mochitest and it seems to be impossible to do so. Hereby I declare defeat, sorry about that. :/
| Assignee | ||
Comment 7•6 years ago
|
||
Comment 9•6 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 10•6 years ago
|
||
Verified fixed with Nightly 75.0a1 20200227094956 on Windows 8.1
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Description
•