element-hq / element-hq/element-web

Windows desktop notifications can stop after Squirrel shortcut/AppUserModelID drift

Open
#33,836 0 comments 0 reactions 0 assignees View on GitHub
A-Electron A-Notifications A-Packaging O-Occasional S-Major T-Defect Z-Platform-Specific Z-Windows
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

I investigated a Windows Element Desktop installation where OS notifications had stopped appearing after normal Element Desktop updates and a Windows user-profile/Desktop folder migration away from OneDrive.

Observed local state before repair:

1. Element Desktop was installed via the Windows Squirrel installer under `%LOCALAPPDATA%\element-desktop`.
2. Current executable was `%LOCALAPPDATA%\element-desktop\app-1.12.21\Element.exe` (`FileVersion: 1.12.21`).
3. Element itself still sets `app.setAppUserModelId(buildConfig.appId)`, and the packaged `electron_appId` in `app.asar` is `im.riot.app`.
4. Windows Start Apps listed two Element identities at the same time:
- `Element` / `com.squirrel.element-desktop.Element`
- `Element` / `im.riot.app`
5. Windows notification settings only had a historical `im.riot.app` notification record, with the last real notification recorded on 2026-05-31. No newer Element notifications were recorded until I manually sent a test toast.
6. Start Menu / pinned shortcuts were stale or inconsistent:
- `%APPDATA%\Microsoft\Windows\Start Menu\Programs\Element.lnk` had working directory `%LOCALAPPDATA%\element-desktop\app-1.12.20`.
- `%APPDATA%\Microsoft\Windows\Start Menu\Programs\Element\Element.lnk` had originally been created for `app-1.12.18`.
- The Squirrel shortcut log from the original install showed it tried to create the desktop shortcut at `%USERPROFILE%\OneDrive\Desktop\Element.lnk`, but the current Windows known Desktop folder is `%USERPROFILE%\Desktop`.
7. Squirrel logs also show the shortcut being created with `toastActivatorCSLID 3c1b0cac-12aa-54d0-85ac-9a4ca6e1d795`.
8. Querying `HKCR\CLSID\{3c1b0cac-12aa-54d0-85ac-9a4ca6e1d795}` did not find a registered CLSID on this machine.

The issue became visible to the user as “Element notifications do not work”. Other Windows app notifications were working.

### Outcome

#### What did you expect?

Element Desktop updates and user Desktop folder changes should not leave Windows with conflicting/stale Element notification identities. Element should continue to show Windows toast notifications under the AppUserModelID it actually uses (`im.riot.app`), or the installer/update path should migrate the app identity consistently.

#### What happened instead?

Windows ended up with inconsistent Element registrations and stale shortcuts across versions/locations. Element was running from `app-1.12.21`, but Start Menu data still included older shortcut state (`app-1.12.20` / `app-1.12.18`) and both `im.riot.app` and `com.squirrel.element-desktop.Element` showed up as Element app identities.

After manually running:

```powershell
%LOCALAPPDATA%\element-desktop\Update.exe --createShortcut=Element.exe
```

Squirrel recreated the official shortcut using the current Windows Desktop folder (`%USERPROFILE%\Desktop`) and current working directory (`app-1.12.21`). A manual Windows toast sent with AppUserModelID `im.riot.app` was accepted by Windows and updated the notification record.

This suggests the failure is in the Windows packaging/update/shortcut/AppUserModelID registration path rather than in global Windows notification settings.

### Operating system

Windows 10 Pro, 64-bit, OS build 26200

### Browser information

Element Desktop / Electron app, installed via Windows Squirrel updater

### URL for webapp

_No response_

### Application version

Element Desktop 1.12.21 (`FileVersion: 1.12.21`, installed under `%LOCALAPPDATA%\element-desktop\app-1.12.21`)

### Homeserver

Private/self-hosted Matrix homeserver. The Matrix `/_matrix/client/v3/pushrules/` endpoint was reachable during diagnosis and returned the expected `401 Unauthorized` without an access token, so this did not look like a homeserver outage.

### Will you send logs?

No

### Additional context

Relevant existing issues that look adjacent but not the same:

- #32300: Desktop notifications now show an app ID on Windows
- #30395: Accessibility: Notification announcements missing

Possible areas to inspect:

- Whether Windows Squirrel shortcut creation/update should remove or update stale top-level `Element.lnk` entries when current shortcuts live under `Start Menu\Programs\Element\Element.lnk`.
- Whether Element Desktop should still use `im.riot.app` while Windows/Squirrel also exposes `com.squirrel.element-desktop.Element`.
- Whether the toast activator CLSID should be registered/validated during update or shortcut repair.
- Whether updater shortcut creation correctly tracks Windows known-folder changes, especially after OneDrive Desktop redirection is removed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.