Skip to content

fix: align AppUserModelId with electron-builder appId#133

Merged
edospadoni merged 1 commit into
mainfrom
fix/windows-notification-permissions-aumid
Apr 22, 2026
Merged

fix: align AppUserModelId with electron-builder appId#133
edospadoni merged 1 commit into
mainfrom
fix/windows-notification-permissions-aumid

Conversation

@edospadoni
Copy link
Copy Markdown
Member

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:

  • NSIS installer registers the shortcut with AUMID com.nethesis.nethlink.app (from appId in electron-builder.yml).
  • The runtime process declared AUMID NethLink (via app.setAppUserModelId(app.getName()) in src/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 installer appId. 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, so app.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.
  • No jump lists or user tasks are registered in the codebase, so no data is orphaned.
  • In production the toast header still reads "NethLink" because Windows resolves the AUMID to the Start Menu shortcut name.
  • Users who already had NethLink pinned to the taskbar on a prior version may need to unpin and re-pin once after updating, since the old pinned entry is bound to the previous transient AUMID.

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.
@github-actions
Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/24770843201.
Commit: 3191782

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@edospadoni edospadoni merged commit 586609c into main Apr 22, 2026
4 checks passed
@edospadoni edospadoni deleted the fix/windows-notification-permissions-aumid branch April 22, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant