Repository navigation
[Bug] Notifications not working; add E2E coverage #932
Copy link
Copy link
Closed
Labels
testTest additions, fixes, or harness work.Test additions, fixes, or harness work.
Description
Summary
Desktop notifications are effectively broken (no OS toasts / no reliable in-app notification pipeline in real use). We need a root-cause fix across the stack (permissions, Tauri / CEF bridge, socket events from core, Redux, UI) and a proper E2E regression so this cannot ship broken again.
Problem
- User-visible: Users do not get expected native and/or in-app notifications for events that should surface (e.g. core-originated
core_notification, chat completion policies, or other product-defined triggers). - Engineering risk: The path touches multiple layers —
app/src/lib/nativeNotifications/(e.g.core_notificationsubscription onsocketService), Tauritauri-plugin-notificationinapp/src-tauri/, CEF notification wiring inapp/src-tauri/src/webview_accounts/mod.rs, and coresrc/openhuman/notifications/(e.g.bus.rs→ socket). Without a working E2E, regressions are likely.
Product ask: “Notifications do not work at all” — treat as P0/P1 until a minimal happy path is proven on CI (Linux) and documented for macOS local.
Scope of the fix (non-exhaustive; triage to define)
- OS permissions — Request and verify notification permission on supported platforms; fail gracefully with visible UX when denied.
- Tauri / webview — Ensure
showNativeNotification/ plugin paths actually fire in the built app (CEF + notification plugin; no silent no-ops). - Core → UI — Confirm
core_notification(or the canonical event name) is emitted from core and received in the renderer; fix any break insocketServicesubscription or bus wiring. - In-app list — If the product also requires the Notifications page /
notificationSliceto update, align with the same event source of truth. - Document the supported notification types in one place (what is expected to toast vs in-app only).
E2E requirements (must ship with the fix)
Add an E2E spec (WDIO) that proves at least one end-to-end path, for example:
- Option A (preferred if automatable in CI): Drive the app, trigger a known code path that should emit a notification (e.g. via mock server / admin behavior, or a dev-only E2E hook that dispatches the same payload
nativeNotificationsexpects), then assert a verifiable outcome:- DOM / Redux — e.g. a new item in the in-app notification list, or a specific
data-testid/ text on/notificationsor - Instrumented check —
browser.execute(whensupportsExecuteScript()on tauri-driver) to read Redux state or a test-only global the build exposes only under a test flag.
- DOM / Redux — e.g. a new item in the in-app notification list, or a specific
- Option B (macOS-only supplement): If native OS toasts are not assertable in Linux CI, document that and add a smoke step for macOS or keep CI focused on in-app guarantees plus a unit/integration test for the native bridge.
Harness alignment (see docs/E2E-TESTING.md):
- Spec lives under
app/test/e2e/specs/, e.g.notifications.spec.ts. - Run with
bash app/scripts/e2e-run-spec.sh test/e2e/specs/<file>.ts <id>; usewaitForWebView/ helpers fromapp/test/e2e/helpers/element-helpers.tsas in other flows. - Use the shared mock backend and isolated
OPENHUMAN_WORKSPACEpere2e-run-spec.shdefaults.
Avoid: E2E that only mocks Vitest; we need desktop coverage.
Acceptance criteria
- Repro / root cause documented in the PR (what was broken: permission, event name, dead subscription, Tauri init, etc.).
- Fix merged — At least one reliable notification path works for shipped desktop (define which events in the PR).
- E2E — New or extended WDIO spec committed; CI (Linux) passes; instructions in PR for macOS if different.
- No secrets / flakes — Deterministic waits, mock-only network, no wall-clock flakiness beyond documented harness limits.
- Short doc — Update
docs/E2E-TESTING.mdor a line in the spec README listing the notifications flow and how to run it.
Related code (starting points)
app/src/lib/nativeNotifications/service.ts—core_notificationlistener, socket wiringapp/src/lib/nativeNotifications/tauriBridge.ts— nativeshowNativeNotificationapp/src-tauri/src/lib.rs—tauri-plugin-notificationsrc/openhuman/notifications/bus.rs— core → socket emissionapp/src/pages/Notifications.tsx/app/src/store/notificationSlice.ts— in-app listapp/test/e2e/— new spec + helpers
Metadata
Metadata
Assignees
Labels
testTest additions, fixes, or harness work.Test additions, fixes, or harness work.
Type
Projects
- StatusShow more project fieldsDone
Activity