fix: align AppUserModelId with electron-builder appId#133
Merged
Conversation
Sets the runtime AUMID to match the installer appId so Windows correctly associates emitted toast notifications with the app identity registered by the NSIS shortcut. Previously the runtime AUMID was the plain app name while the Start Menu shortcut carried the reverse-DNS appId: the mismatch caused Windows to ignore the per-app notification toggle in system settings (notifications fired even when the user disabled them) and produced taskbar pinning glitches where the pinned icon did not track the running instance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
On Windows, toast notifications were always delivered even when the user had disabled notifications for the app in Settings > System > Notifications, while on macOS the OS-level toggle was correctly respected.
Root cause
Windows tracks per-app notification permissions by AppUserModelId (AUMID). The permission toggle that the user sees in system settings is associated with the AUMID registered by the Start Menu shortcut. In this project there was a mismatch:
com.nethesis.nethlink.app(fromappIdinelectron-builder.yml).NethLink(viaapp.setAppUserModelId(app.getName())insrc/main/main.ts).Because the emitted toasts were tagged with an AUMID that did not match the one the user toggled off, Windows had no permission entry to match and delivered the notifications anyway. The same mismatch is also responsible for taskbar pinning glitches (pinned icon not activating when the app is running, second ghost icon appearing on launch).
Fix
Set the runtime AUMID explicitly to
com.nethesis.nethlink.app, matching the installerappId. Notifications are now correctly suppressed by Windows when the user disables them, and the taskbar pinned icon properly tracks the running instance.Scope / regressions
app.setName('NethLink')is unchanged, soapp.getName()still returns"NethLink"and all consumers (tel:/callto:/nethlink:protocol registration in the Windows registry, window titles, tray, menus, locales) keep working as before.