Closed Bug 1822817 Opened 1 year ago Closed 1 year ago

Web notifications with images not displaying for Windows 8(.1)

Categories

(Toolkit Graveyard :: Notifications and Alerts, defect, P1)

Firefox 111
Unspecified
Windows 8.1

Tracking

(relnote-firefox 112+, firefox-esr102 unaffected, firefox111 wontfix, firefox112+ verified, firefox113+ verified)

VERIFIED FIXED
113 Branch
Tracking Status
relnote-firefox --- 112+
firefox-esr102 --- unaffected
firefox111 --- wontfix
firefox112 + verified
firefox113 + verified

People

(Reporter: kanapa1, Assigned: nrishel)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [fidedi])

Attachments

(7 files)

Steps to reproduce:

  1. Launch Firefox (at least version 111.0 stable).
  2. Go to this webpage: https://www.bennish.net/web-notifications.html to test the functionality of the new native Windows notifications that were introduced in Firefox 111.0.
  3. Press the "Authorize" button in the body of the page and then allow the website to send notifications by pressing "Allow" in the Firefox notification permission doorhanger.
  4. Press the "Show" (or "Show in 5s") button in the body of the page.
  5. See what is described in the "Actual results" section.

Actual results:

Even though the notification permission has been granted correctly (as confirmed by the text "Permission to display: granted" displayed in that mini-console in the body of the page), no notification is displayed on the screen and no notification sound is played either (native Windows 8.1 notifications have a distinctive sound effect). Since Firefox 111.0, web notifications on Windows 8.1 are simply no longer usable at all.

Expected results:

Some form of notifications should be shown, at least the old non-native one. However, ideally, since Windows 8.1 has built-in support for notifications, and native notifications have been enabled by default in Firefox 111.0 for all users, they should also work on Windows 8.1.

Additional context:

I'm pretty sure the problem is with Firefox and not with my Windows 8.1 installation because, for example, the native Windows 8.1 notifications in Telegram Desktop work correctly for me (I can send a screenshot if needed). Also, the Firefox profile used doesn't matter, I'm able to reproduce this issue every single time.

Thanks to Mozregression, I was able to find the regressor, bug 1497425 (the relevant pushlog from Mozregression).

Keywords: regression
Regressed by: 1497425

[Tracking Requested - why for this release]:
Important functionality regressed.

Greg: Do you have any other details? Are there errors in the browser console (ctrl-shift-j, not the standard devtools console) ?

Flags: needinfo?(kanapa1)

Here are all the multiprocess browser console logs from a clean Firefox profile after accessing the aforementioned website:

Loading failed for the <script> with source “https://www.bennish.net/js/awstats_misc_tracker.js”. web-notifications.html:188:1
While creating services from category 'app-startup', service for entry 'ExtensionsChild', contract ID '@mozilla.org/extensions/child;1' does not implement nsIObserver.
Some cookies are misusing the recommended “SameSite“ attribute 3
Cookie “_ga” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Cookie “_gid” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Cookie “_gat_gtag_UA_48376594_4” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Created a new notification ... web-notifications.html:147:25
Notification { onclick: onclick(), onshow: onshow(), onerror: onerror(), onclose: onclose(), title: "Notification #1", dir: "auto", lang: "", body: "This is the text body of the notification. \nPretty cool, huh?", tag: "1", icon: "images/Sexy_Ben.jpeg" }
web-notifications.html:148:25

I don't see anything related to the Notifications API here besides the entries logged by the website itself (for debugging purposes?). Perhaps I'm doing something wrong, if so, please let me know.

Flags: needinfo?(kanapa1)

(In reply to Greg-21 from comment #2)

Here are all the multiprocess browser console logs from a clean Firefox profile after accessing the aforementioned website:

Loading failed for the <script> with source “https://www.bennish.net/js/awstats_misc_tracker.js”. web-notifications.html:188:1
While creating services from category 'app-startup', service for entry 'ExtensionsChild', contract ID '@mozilla.org/extensions/child;1' does not implement nsIObserver.
Some cookies are misusing the recommended “SameSite“ attribute 3
Cookie “_ga” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Cookie “_gid” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Cookie “_gat_gtag_UA_48376594_4” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite analytics.js:25:486
Created a new notification ... web-notifications.html:147:25
Notification { onclick: onclick(), onshow: onshow(), onerror: onerror(), onclose: onclose(), title: "Notification #1", dir: "auto", lang: "", body: "This is the text body of the notification. \nPretty cool, huh?", tag: "1", icon: "images/Sexy_Ben.jpeg" }
web-notifications.html:148:25

I don't see anything related to the Notifications API here besides the entries logged by the website itself (for debugging purposes?).

I agree.

Perhaps I'm doing something wrong, if so, please let me know.

I think you're doing everything right, but something is clearly broken despite there not being errors in the browser console. :nrishel, are you able to take a look / suggest further triage steps?

Flags: needinfo?(nrishel)
See Also: → 1822842

We've probably missed a trick somewhere and the Windows 10 functionality is kicking in (and failing) on Windows <10.

Greg-21: could you run with MOZ_LOG=WindowsAlertsService:5 in your environment, as described in https://firefox-source-docs.mozilla.org/xpcom/logging.html? You could also look in the Windows Event Log and tell us what the debug logging says; see Bug 1822842 for what that means and https://www.howtogeek.com/123646/htg-explains-what-the-windows-event-viewer-is-and-how-you-can-use-it/ for some instructions on how to view that log.

Thanks!

Attached file log.txt

I set the environment variables MOZ_LOG=WindowsAlertsService:5,timestamp,sync and MOZ_LOG_FILE=%USERPROFILE%\Desktop\log.txt (I couldn't get the logs to be written to disk without the sync special module), and then followed my own steps to reproduce from the bug description. However, this time I triggered the notification 3 times (instead of 1) in hopes of getting better logs. I'm attaching the only log file that is not empty.

I also checked the Windows Event Viewer, but couldn't find any errors or warnings even loosely related to Firefox or notifications.

If you need any more information to better understand the issue, please let me know.

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true

The bug is marked as tracked for firefox111 (release). However, the bug still isn't assigned.

:tspurway, could you please find an assignee for this tracked bug? Given that it is a regression and we know the cause, we could also simply backout the regressor. If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit auto_nag documentation.

Flags: needinfo?(tspurway)

Will look at this first thing Monday. If it's a trivial fix we can implement that, otherwise we should probably gate native notifications to Win10+ by default.

Assignee: nobody → nrishel

I confirm this issue in Win 8.1 for FF111

:nrishel could you triage this to add a priority/severity?

What is happening here is that the fallback to XUL notifications is not occurring because adding an image to the notification causes an async image load, which delays notification creation/send errors until after the decision point for falling back to XUL. If e.g. you launch a notification from https://bgrins.github.io/devtools-demos/misc/notifications.html, the the fallback mechanism gets set and sites like https://www.bennish.net/web-notifications.html start working (with XUL notifications) again.

I'll discuss this with my team tomorrow and try to have a decision/patch up in the next couple days.

Severity: -- → S2
Flags: needinfo?(nrishel)
Priority: -- → P1
Summary: Since Firefox 111, web notifications are not shown at all → Web notifications with images don't trigger XUL notification fallback for Windows 8(.1)
Flags: needinfo?(tspurway)

Do I understand correctly that the way Mozilla is taking here is to restrict the new native notifications to Windows 10+ only? Because I don't really know what to expect, and I've seen screenshots of working native notifications on Windows 8/8.1, but that was a while back, and plans may have changed.

(In reply to Greg-21 from comment #12)

Do I understand correctly that the way Mozilla is taking here is to restrict the new native notifications to Windows 10+ only? Because I don't really know what to expect, and I've seen screenshots of working native notifications on Windows 8/8.1, but that was a while back, and plans may have changed.

We don't know yet. I'll leave myself an NI to update when we know more.

Flags: needinfo?(nalexander)
Duplicate of this bug: 1823393

We can get native notifications with text working again fairly easily. Unfortunately to the best of my research and testing notifications with images won't show the image for non-UWP applications on Windows 8 - including in older versions of Firefox. This regresses features which worked in the old XUL-style notifications.

We'll probably fix text-only notifications for people who want to explicitly enable this feature, but turn native notifications off by default for Windows 8.

:nrishel in terms of timing for the next steps on Comment 15.
Since this is P1/S2, do we expect a patch for uplift to 112, or even for a possible 111 dot release?

Flags: needinfo?(nrishel)

If it helps, I've attached a screenshot showing a native Windows 8.1 notification from Telegram Desktop, which is a regular Qt5-based program and is one of the few programs I use that offer push notifications.

From what I can see in the screenshot, the layout of the native Windows 8.1 notifications is similar to the non-native ones in Firefox. It features a headline, some detailed text with support for special Unicode characters such as emojis, a logo of the program from which the notification comes, and, most importantly, an image. In Telegram Desktop, it is rounded and forms a circle, but this is just a design choice (since profile pictures in Telegram are also circular), and it could just be a square image if they wanted to.

IToastNotification2 is not available in Windows 8, so querying it caused the toast to fail. When the content was only text, the toast would immediately fail triggering a fallback to XUL style alerts. When it contained an image, the async image load caused the toast to fail after the fallback branch had been decided.

Note: This does not fix the issue that notifications with images do not include the image. Online discussion and testing suggest images are not supported for Win32 desktop apps on Windows 8, but no definitive documentation was found. Similar projects such as Chromium don't appear to support Windows 8 Toast notifications.

:Greg-21 thanks for the information! I didn't see anything significantly different in Telegram's source code but knowing that there is that it can work for desktop applications is helpful.

:dmeehan We will want to uplift to the earliest beta upon landing changes, maybe tag along on a point release if we can make one but I don't think it's critical enough to warrant it by itself.

Flags: needinfo?(nrishel)
Attachment #9324810 - Attachment description: Bug 1822817 - Fix Windows 8 native notifications failing. r=nalexander → Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander
Summary: Web notifications with images don't trigger XUL notification fallback for Windows 8(.1) → Web notifications with images not displaying for Windows 8(.1)

Use PNGs instead of BMPs for Windows toast notification images.

BMPs were isolated as the cause of Windows toasts failing to display images when provided in the src attribute of the <image> tag for Windows 8. The same was not observed for PNGs.

This issue only affects Windows 8(.1).

Depends on D173496

We don't have another dot release planned for 111, so marking as a wontfix for 111.

Status: NEW → ASSIGNED
Whiteboard: [fidedi]
Attachment #9325335 - Attachment description: Bug 1822817 - Part 2: Fix Windows 8(.1) notification images not showing. r=nalexander → Bug 1822817 - Part 2: Fix Windows 8 notification images not showing. r=nalexander
Pushed by nrishel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/10cf3b915cd9
Part 1: Fix Windows 8 native notifications failing. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/a68af2e5fe5b
Part 2: Fix Windows 8 notification images not showing. r=nalexander,cmartin
https://hg.mozilla.org/integration/autoland/rev/a5c34268bcac
Post: Log when Windows native notifications fail. r=nalexander
Flags: needinfo?(nalexander)

The patch landed in nightly and beta is affected.
:nrishel, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox112 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(nrishel)

Is this something we can pref off native notifications rather than uplift this? Seems a bit risky for RC

If we could pref off only for Windows 8 it would be fine; I would have strong reservations for prefing off native notifications for all versions of Windows due to it's high visibility and iiuc accessibility benefits. FWIW I don't think this change set is particularly risky as it's just gating off APIs not available in older Windows versions and swapping out a bmp writer for png.

Flags: needinfo?(nrishel) → needinfo?(nalexander)

(In reply to Nick Rishel [:nrishel] from comment #27)

If we could pref off only for Windows 8 it would be fine; I would have strong reservations for prefing off native notifications for all versions of Windows due to it's high visibility and iiuc accessibility benefits. FWIW I don't think this change set is particularly risky as it's just gating off APIs not available in older Windows versions and swapping out a bmp writer for png.

I concur on both points:

  • this has been the only substantive issue found with native notifications on release; if we change release behaviour by preffing this off I expect we'd have more feedback about the change on Windows 10+ than issues on Windows <10;
  • this particular change is certainly not lowest risk but I don't think it's much more than low risk: it's isolated and can be easily verified by QA in Nightly before it hits RC.

Given the small size of the Windows 8/8.1 population, we could also just leave this for a release.

Flags: needinfo?(nalexander)

Comment on attachment 9324810 [details]
Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander

Beta/Release Uplift Approval Request

  • User impact if declined: Native notifications won't work for Windows 8, and notifications with images will silently fail if XUL fallback has not previously been triggered by a image-less notification.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: In Windows 8 navigate to https://www.bennish.net/web-notifications.html, verify that native notification shows after authorizing and clicking show.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only changes are gating APIs not available in Windows 8 and changing from writing bmp images to png.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9324810 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Attachment #9324811 - Flags: approval-mozilla-beta?
Attachment #9325335 - Flags: approval-mozilla-beta?
QA Whiteboard: [qa-triaged]

Hey Nick, I was able to reproduce the issue with Firefox 111.0 on Windows 8.1 by following the STR from Comment 0, but it seems that the notification is still not appearing on Firefox 113.0a1 (2023-04-04 and 05 from treeherder). Any idea?

Flags: needinfo?(nrishel)

Comment on attachment 9324810 [details]
Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander

Approved for 112.0rc2

Attachment #9324810 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9324810 [details]
Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander

Moving flags to release since we are in RC week

Attachment #9324810 - Flags: approval-mozilla-beta+ → approval-mozilla-release+
Attachment #9324811 - Flags: approval-mozilla-beta? → approval-mozilla-release+
Attachment #9325335 - Flags: approval-mozilla-beta? → approval-mozilla-release+

(In reply to Catalin Sasca, QA [:csasca] from comment #30)

Hey Nick, I was able to reproduce the issue with Firefox 111.0 on Windows 8.1 by following the STR from Comment 0, but it seems that the notification is still not appearing on Firefox 113.0a1 (2023-04-04 and 05 from treeherder). Any idea?

I just tested the STR in an updated Windows 8.1 VM for the current m.org Firefox 113.0a1 and was unable to reproduce the issue. I have noticed that sometimes notifications don't appear for a short window after Firefox is opened which would be a separate issue not specific to Windows 8.1, is this maybe what you were seeing?

Flags: needinfo?(nrishel) → needinfo?(catalin.sasca)
Attached image no notif win 8.1.gif

Hey Nick, I'll attach a screencast with the behavior on my sistem (native, clean environment of Win 8.1 fully updated). The notification doesn't appear at all on the latest Firefox 113.0a1.

Flags: needinfo?(catalin.sasca)

I would like to add my 2 cents if you don't mind.

Yesterday I tested Firefox Nightly 113.0 (build dated 2023-04-05) on my physical machine from which I reported this bug, and I was unable to get any notifications to appear on the screen. So I booted up a virtual machine with a completely clean Windows 8.1 Update 1 OS without any updates from Windows Update yet, and decided to test the notifications in Firefox Nightly 113.0 (build dated 2023-04-05 as well) there. To my surprise, they worked without any problems in both 64-bit and 32-bit Firefox Nightly.

Today I reinstalled Firefox Nightly (build dated 2023-04-05 as well) on my physical machine, and it turns out that... now notifications work here too. I don't know what's going on.

But there is one thing in common, single builds from Mozregression do not work either locally or in a virtual machine.

Comment on attachment 9324810 [details]
Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander

Decided not to take this in RC and continue the investigation

Attachment #9324810 - Flags: approval-mozilla-release+ → approval-mozilla-release-
Attachment #9324811 - Flags: approval-mozilla-release+ → approval-mozilla-release-
Attachment #9325335 - Flags: approval-mozilla-release+ → approval-mozilla-release-

:csasca Just a check, were you testing in builds without running the installer? If yes could you double check if the same behavior occurs when running from an installed exe?

:Greg-21 Same-ish question above, is there any correlation with things not working and installed vs non-installed runs?

Status: RESOLVED → REOPENED
Flags: needinfo?(kanapa1)
Flags: needinfo?(catalin.sasca)
Resolution: FIXED → ---

I was testing with zip ones. Just tried with an installation of latest 113.0a1 (2023-04-06) and it seems this way the notifications will work. The issue seems to be on the zip packages.

Flags: needinfo?(catalin.sasca)

:nrishel, I've just checked a few more configurations using the current Firefox Nightly 113.0 dated 2023-04-06, and your theory with Firefox distribution methods that are not .exe/.msi installers being the culprit here may be true.

This may also explain why I've never been able to get any notifications to appear on the screen when using builds from Mozregression (which are distributed in ZIP archives, aren't they?).

That being said, should I file another bug specifically for this new discovery? Because, in my humble opinion, this newly discovered edge case is not something that should block the uplift, as currently in the latest stable Firefox 111.0.1 (and possibly soon in 112.0) a large part of notifications do not work at all anyway.

Flags: needinfo?(kanapa1)

:Greg-21 Agreed that portable Win8 notification issues should be a new bug; CC me when you create a new one.

Closing this as the remaining issues relate to the aforementioned separate bug.

Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED

Re-verified on a installed Firefox 113.0a1 (2023-04-09) and the notifications work as expected on Win 8.1. Closing this as verified based on the previous comments.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+

Is there any chance of uplifting this to 112.0/dot release since it turned out that the patch works as expected and fixes a fairly serious regression, in my opinion?

It is still currently being tracked for 112, which means yes, there is still a chance of uplift for a dot release. If there are circumstances in which it cannot/shouldn't be uplifted, the 112 status flag will change to wontfix.

Comment on attachment 9324810 [details]
Bug 1822817 - Part 1: Fix Windows 8 native notifications failing. r=nalexander

Approved for 112.0.2 dot release

Attachment #9324810 - Flags: approval-mozilla-release- → approval-mozilla-release+
Attachment #9324811 - Flags: approval-mozilla-release- → approval-mozilla-release+
Attachment #9325335 - Flags: approval-mozilla-release- → approval-mozilla-release+

Verified that the issue is fixed and notifications work as expected on Firefox 112.0.2 under Windows 8.1.

Regressions: 1833782
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: