Skip to content

fix(tauri): prevent ios blank screen#2240

Merged
peterchinman merged 1 commit intomainfrom
peter/fix-tauri
Mar 27, 2026
Merged

fix(tauri): prevent ios blank screen#2240
peterchinman merged 1 commit intomainfrom
peter/fix-tauri

Conversation

@peterchinman
Copy link
Copy Markdown
Contributor

@peterchinman peterchinman commented Mar 27, 2026

Fixes issue introduced in #2228

  1. BrowserNotificationModal was embedded inside PlatformNotificationProvider. On
    Tauri/iOS, MaybePushNotificationRegistration renders PlatformNotificationProvider
    outside UserContextProvider (it wraps the entire app tree). When that provider
    rendered BrowserNotificationModal, the modal called useIsAuthenticated()
    unconditionally — which throws "UserContext must be used within " since UserContextProvider hadn't been entered yet. This uncaught error caused the
    blank screen.
  2. A second PlatformNotificationProvider (no overrideDefault) was added in Root.tsx.
    On iOS, createDefaultBrowserInterface checks Notification in window — if it's present
    (iOS 16.4+), it calls createTabLeaderSignal → new Tab() →
    navigator.locks.request(...), which may not exist on older iOS WKWebView. This also
    silently shadowed the correct Tauri push notification provider.

@peterchinman peterchinman requested a review from a team as a code owner March 27, 2026 20:52
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

The BrowserNotificationModal component was relocated from within PlatformNotificationProvider to a top-level position in Root.tsx, requiring updates to the component hierarchy in both files and wrapping of PlatformNotificationProvider around children in the non-Tauri execution path of TauriProvider.tsx.

Changes

Cohort / File(s) Summary
Notification modal repositioning
js/app/packages/app/component/Root.tsx, js/app/packages/notifications/components/PlatformNotificationProvider.tsx
BrowserNotificationModal removed from PlatformNotificationProvider and mounted directly inside UserContextProvider in Root.tsx; provider component order adjusted accordingly.
Tauri provider integration
js/app/packages/tauri/src/TauriProvider.tsx
PlatformNotificationProvider now wraps props.children in the non-Tauri execution path; Tauri-specific branch behavior remains unchanged.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title follows conventional commits format (fix:) and is under 72 characters (36 chars), but is overly abbreviated and doesn't convey the main issue being fixed. Consider using a more descriptive title that clearly explains the issue, such as: 'fix(tauri): prevent blank screen from BrowserNotificationModal outside UserContextProvider'
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly explains the bug being fixed, root causes, and how the changes address both issues introduced in PR #2228.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/app/packages/queries/soup/normalized-cache/operations.test.ts`:
- Around line 226-237: The test uses unsafe casts ((filter as
any)[filterKey][idKey] and (filter as any)[key]) which violates the no-any rule;
replace these casts by defining a local typed interface for the ID filter map
(e.g. type IdFilterMap = Record<string, Record<string, string[]>>) or a more
specific shape that matches `filter` and use it to assert values, then access
properties as (filterTyped[filterKey][idKey]) and (filterTyped[key]) where
filterTyped is the typed variable; update the test to import or declare the type
near the test and remove both any casts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 86b1b291-28b8-4022-a7cb-1ef011af0fa0

📥 Commits

Reviewing files that changed from the base of the PR and between a23b52e and d0101b6.

📒 Files selected for processing (6)
  • js/app/packages/app/component/Root.tsx
  • js/app/packages/core/service.ts
  • js/app/packages/core/util/maybeResult.ts
  • js/app/packages/notifications/components/PlatformNotificationProvider.tsx
  • js/app/packages/queries/soup/normalized-cache/operations.test.ts
  • js/app/packages/tauri/src/TauriProvider.tsx
💤 Files with no reviewable changes (1)
  • js/app/packages/notifications/components/PlatformNotificationProvider.tsx

@peterchinman peterchinman changed the title fix(tauri): prevent blank screen from BrowserNotificationModal rendering outside UserContextProvider fix(tauri): prevent ios blank screen Mar 27, 2026
@peterchinman peterchinman merged commit a97f201 into main Mar 27, 2026
22 checks passed
@peterchinman peterchinman deleted the peter/fix-tauri branch March 27, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant