Repository navigation
Description
Summary
In the iOS app (the WebView shell), tapping a bb push notification while the app's page is still alive loads a second copy of the web app in a new WebView instead of opening the thread in the page that is already running. The old WebView stays mounted underneath and is never released, so every tap costs a full page load (white screen, then skeleton) and one more WebContent process. Deep links and shares remount the WebView (also a full reload), and bb thread open stacks a WebView too, although the page already handles that signal itself. Expected: the live page opens the thread in place, and there is only ever one WebView.
Versions and environment
- bb
mainatb0ddaad731565d7e4de68d824120d802fc78f7d5(server, web app andapps/mobileJS), run from source with its own data dir, seeded withseed-perf-db(2 projects, 12 threads). - iOS Simulator, iPhone 17 Pro, iOS 26.5, Xcode 26.6 (macOS 26.5.2). App: Release simulator build of
apps/mobilefrom the same commit (samepackage.jsonand lockfile), JS bundle fromexpo export:embed --platform ios --dev false --bytecode. - Server added in the app as a Direct URL server (
http://127.0.0.1:41999). Push notifications turned on in the app's Settings → Notifications. - The JS involved (
router.pushof/webview) is the same on Android; I did not test Android.
Steps to reproduce
- Start bb from
mainwith a fresh data dir and seed it:node --conditions=source --import tsx packages/scripts/src/commands/seed-perf-db.ts --data-dir <dir> --projects 2 --threads 12 --events 30000. - Install the iOS app on a simulator, add the server, turn on push notifications, open any thread.
- Put the app in the background (open Settings).
- Send a notification for a different thread and tap its banner:
with
xcrun simctl push <udid> app.getbb.mobile payload.jsonpayload.json:{"aps":{"alert":{"title":"Test bot","body":"done"}},"threadId":"thr_…","projectId":"proj_…","serverUrl":"http://127.0.0.1:41999"} - Count the simulator's WebContent processes (
ps -axo pid,ppid,command, children of the simulator'slaunchd_simwhose command containscom.apple.WebKit.WebContent). - Repeat steps 3 to 5.
The same stacking happens with bb thread open <thread id> while the app is open. A deep link (xcrun simctl openurl <udid> bb://projects/<p>/threads/<t>) remounts the WebView instead of stacking.
Expected vs actual
Expected: the app returns to the live page and the page opens the notified thread; one WebView; no document load.
Actual (logging proxy between the simulator and the server; screenshots every ~150 ms after the tap):
tap 1: GET /projects/proj_n2izyamrfz/threads/thr_vesq97weyi (Sec-Fetch-Dest: document)
GET /ws (a second WebSocket)
WebContent processes: 1 -> 2 (RSS 512 MB, 506 MB)
tap 2: GET /projects/proj_n2izyamrfz/threads/thr_gmf86yn3mk (document)
WebContent processes: 2 -> 3 (RSS 512 MB, 493 MB, 490 MB)
On screen: a white page from about 0.5 s to 0.8 s after the tap, then the thread skeleton, then the thread at 1.5 to 1.8 s. The page underneath also comes back to life: it refetches its own timeline and reconnects its own WebSocket on every resume.
Evidence
- Notification taps push a new screen:
PushNotificationsHost.tsx#L82-L95. Thewebviewscreen has nogetId/dangerouslySingular(RootNavigator.tsx#L80-L83), sorouter.pushalways adds anotherProfileWebViewScreenwith its own WebView, and the native stack keeps the one below mounted (it hasgestureEnabled: false, so it is never popped). bb thread opendoes the same fromThreadOpenSignalHandler.tsx#L16, while the page inside the WebView already handles the same signal inAppLayout.tsx#L518(the proxy log shows the live page fetching the new thread's timeline 0.4 s before the shell's second WebView requests the document).- Deep links and shares change
requestedPath, which is part of the WebView key (ProfileWebViewScreen.tsx#L92-L95,#L356), so each one remounts the WebView. - Real-device context: traces from one iPhone running the TestFlight app over a day showed full reloads only after 10+ minutes in the background (none in 86 returns under 10 minutes, 16 in 31 longer ones). That pattern is iOS reclaiming the WebContent process, which the shell already recovers from with
onContentProcessDidTerminate(#L452) and which bb cannot prevent. Every extra stacked WebView adds about half a gigabyte (simulator RSS) that makes those kills more likely.
What I ruled out
- Not bb connect session renewal (
shouldReloadForSession): this repro uses a Direct URL server, and connect sessions last seven days. - Not the app-update or stale-chunk reloads: the server revision did not change during the runs.
- A cold start from a notification (app not running) creates one WebView; the stacking needs a live page.
- Searched open and closed issues for notification, WebView, reload and deep link reports; none match.
Suggested priority and effort
Every mobile user who taps notifications hits it, on every tap. Workaround: force-quit the app. Nothing is lost. A fix prototype (single webview screen plus a navigate bridge event the page acknowledges, with a reload fallback for older servers) is on https://github.com/salemsayed/bb/tree/fix/mobile-shell-open-in-place.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 26, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotmobile,remote,perf.partial-repro.Open notification taps and deep links in the live mobile page (get-bb…
Open notification taps and deep links in the live mobile page (get-bb…