question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.0.4 breaks notification.onclick. Working on 2.7.0, full reproduction

See original GitHub issue
  • Electron Version:
    • 4.0.8
  • windows-installer Version:
    • 3.0.4
  • Last Known Working windows-installer version:
    • 2.7.0

Expected Behavior

The following code should produce a notification and when clicked present an alert

const n = new Notification(1)
n.onclick = function () { alert('click') }

Actual Behavior

Works as expected when using 2.7.0, in 3.0.4 the notification presents, but the click event is never fired

To Reproduce

The following repo has a Notification example and takes care of creating a installer, start menu shortcuts etc. It basically a merge of electron-quick-start and the Handling Squirrel Events section in README

git clone https://github.com/wavebox/electron-quick-start.git -b winstaller-304-shortcut
cd electron-quick-start
npm install
npm run installer

Run the generated installer under electron-quick-start-installer. The app will present a notification and when clicked does nothing.

The same example works with 2.7.0. To try this…

  • Manually uninstall electron-quick-start (this is important)
  • Downgrade electron-winstaller to 2.7.0
  • npm run installer
  • Install and try again

Additional Information

I’ve been digging around what’s going on here, and it’s definately down to the start menu shortcut that gets generated in 3.0.4. Install with 3.0.4 and replace the shortcut with the 2.7.0 version and it works!

Using lnk-parser the only discernable difference that I can find is the value type is different for System.AppUserModel.ID. Here’s the entry for both…

2.7.0

(full 270 output.pdf)

  • Property set GUID 9f4c2855-9f79-4b39-a8d0-e1d42de1d5f3
  • ID 26
  • Value 0x001f (VT_LPWSTR)
    • b2b6457d-4173-5767-b785-be9d6904b546
  • ID System.AppUserModel.ID
  • Value 0x001f (VT_LPWSTR)
    • com.squirrel.electron-quick-start.electron-quick-start

3.0.4

(full 304 output.pdf)

  • Property set GUID 9f4c2855-9f79-4b39-a8d0-e1d42de1d5f3
  • ID 26
  • Value 0x0048 (VT_CLSID)
    • CLSID:b2b6457d-4173-5767-b785-be9d6904b546
  • ID System.AppUserModel.ID Value 0x001f (VT_LPWSTR)
    • com.squirrel.electron-quick-start.electron-quick-start

I could be off the mark here, it could be something different. If you need any more info let me know!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:10

github_iconTop GitHub Comments

5reactions
roytan883commented, Oct 16, 2019

i’m able to make a workaround : create shortcuts and setAppUserModelId manually

let WindowsShortcuts = require('windows-shortcuts');
 WindowsShortcuts.create('%APPDATA%/Microsoft/Windows/Start Menu/Programs/myapp.lnk', process.execPath);
  app.setAppUserModelId(process.execPath);
4reactions
Galkoncommented, Oct 20, 2020

This issue is still not resolved? This is a pretty critical issue for any modern desktop application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser notification onclick event doesn't get fired in chrome ...
I have made a chat application, in that i am notifiying user when a message comes using "Notification" api ...
Read more >
Oracle Critical Patch Update Advisory - April 2022
Oracle Critical Patch Update Advisory - April 2022. Description. A Critical Patch Update is a collection of patches for multiple security vulnerabilities.
Read more >
Bug listing with status RESOLVED with resolution TEST ...
... work it is done with onMouseOver() but do work if its done with onClick(" ... breaks static binaries" status:RESOLVED resolution:TEST-REQUEST severity: ...
Read more >
Changelog for Android and FireOS - Braze
Fixed an issue in BrazePushReceiver where eager In-App Message test displays and Content Card serializations from push notifications wouldn't work unless ...
Read more >
Release Notes for Cisco Identity Services Engine, Release 3.0
In the Cisco ISE GUI, click the Menu icon ( ) and choose Work Centers ... Fix for CSCvu35802 breaks AD group retrieval...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found