notifications: Disable default permission pop up. #12504
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue here was that if the user has not allowed desktop
notifications, the browser would give its own pop up requesting for
permission, this would happen concurrently with zulip's custom green bar
that requests for permission, we would prefer that users interact with
our green bar and so this commit disables the pop up.
This fixes #11504 by removing the cause of the problem.
Testing Plan:
Open firefox, navigate to local env, log in as user 1.
Open chrome, navigate to local env, log in as user 2.
click "i" icon and reset notification permissions to default (ask), allow a reload, confirm that green bar is present. [on chrome]
send message to user 2 from user 1. [from firefox to chrome]
repeat in opposite order and confirm everything to be same.
The gifs bellow show manual testing:
chrome-notification-working
chrome-notification-blocked
firefox-notifcations-working
firefox-notification-blocked
some extra testing:
chrome-notification-ask-later
chrome-notification-never-ask-later
firefox-notifcations-ask-later
firefox-notification-never-ask-later
node tests:
I've just restored our previous test cases, but we could possibly increase coverage here by writing more tests, but maybe that would be a good follow up?