Skip to content

和AI(workbuddy)修复了我之前汇报的#1669错误 - #1839

Merged
eythaann merged 4 commits into
eythaann:masterfrom
QRBG3376:fix/notifications-optional-mode-api
Sep 22, 2026
Merged

eythaann merged 4 commits into
eythaann:masterfrom
QRBG3376:fix/notifications-optional-mode-api

Conversation

@QRBG3376

@QRBG3376 QRBG3376 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

closes #1669

`ToastNotificationManagerForUser::NotificationModeChanged` and
`NotificationMode` are only implemented on Windows 11. On Windows 10 both
fail with E_NOINTERFACE (0x80004002), verified on build 19042.546.

That caused two separate failures, both surfacing to the user as
"notifications never show up":

- `NotificationManager::init` propagated the error with `?`, which skipped
  the `subscribe` right below it. The change listener (or its polling
  fallback) still emitted Added/Removed events but nothing handled them, so
  the notification list stayed frozen on its initial snapshot.
- `get_notifications_mode` returned an error, and the frontend awaits that
  command at module top level. The rejection aborted the state module, so
  neither the notifications widget nor the flyouts widget ever mounted.

Both call sites now treat the mode API as optional:

- `init` logs a warning and continues, so the event handler is always
  registered.
- `get_notifications_mode` falls back to `NotificationsMode::All`, and both
  frontend runes do the same if the command still fails.

The do not disturb toggle is therefore simply inactive on systems without
the API, instead of breaking notifications as a whole.
@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no concrete regression identified in the changed behavior.

Summary

This PR makes notification handling degrade gracefully when the Windows notification-mode API is unavailable, allowing notification subscriptions and Svelte widgets to initialize on affected systems.

  • Continues backend initialization when NotificationModeChanged registration fails.
  • Defaults an unavailable notification mode to All.
  • Adds matching frontend fallbacks for both notification and flyout state.

Reviews (1) · Last reviewed commit: "fix(notifications): degrade gracefully w..."

Restores src/ui/svelte/flyouts/state/mod.svelte.ts and
src/ui/svelte/notifications/state.svelte.ts to their pre-fix state.
@eythaann
eythaann self-requested a review September 22, 2026 11:21
@eythaann
eythaann merged commit 2772a6d into eythaann:master Sep 22, 2026
1 check passed
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.

[BUG] 通知模块不显示或打不开(chinese)Notification module not showing or cannot be opened(english)

2 participants