You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-19] [Sentry: APP-7MV] Web WebGL context creation failure on /search and /home (resurfaced on 9.4.43+) #97104
WebGL context creation fails on low-memory or GPU-constrained browsers while Search or Home renders WebGL-dependent UI. Crash resurfaced on 9.4.43+ after prior fix was paid/closed.
Reproduction
Unknown — see Sentry events. Prior tracker focused on /home; new events also on /search.
🤖 Automated analysis — confidence: High for the root cause, Medium for the exact fix (the failure is environmental, so the goal is graceful degradation, not "making WebGL work"). Same Sentry ID as the paid/closed #93834; PR #94937 fixed one path but left the gap that resurfaced this.
What is the root cause of that problem?
Charts on /home and /search are drawn with Skia/CanvasKit, which asks the browser for a WebGL2 context and never falls back to software. When the browser can't hand one out — hardware acceleration off, GPU blocklisted, memory pressure, or the per-page WebGL context limit exhausted — CanvasKit throws failed to create webgl context: err 0. It throws from an async draw tick (requestAnimationFrame/setTimeout), so no try/catch and no React ErrorBoundary can catch it → it lands in Sentry (APP-7MV, auto.browser.browserapierrors.setTimeout).
PR #94937 added a pre-mount WebGL2 probe (SkiaWebChart/index.tsx:63) that shows an "Unable to display chart" empty state when WebGL2 is unavailable. That fixed the always-broken-GPU case, but the crash resurfaced because the probe can't see the failure that's actually happening now:
The probe reuses one long-lived context and biases toward "supported" (isSkiaWebSupported.ts:8-10, returns true on a lost context at :35-36 and on any exception at :39-40). That softening was intentional — to avoid hiding charts from capable mobile devices — but it means the probe passes while CanvasKit's separate, per-mount context creation can still fail.
This is exactly the /search regression: /search mounts/re-mounts several Skia canvases (Bar, Line, Pie across insight tabs, plus Home's chart may be alive) and can exhaust the browser's per-page context cap (~16 in Chrome). The single-context probe never trips this cap, so it green-lights a mount that then throws.
Evidence chain (file:line)
Probe: SkiaWebChart/isSkiaWebSupported.ts — getContext('webgl2') at L21; its own header comment (L2-10) documents that it holds one context and returns true on ambiguous cases.
No chart-scoped ErrorBoundary anywhere in components/Charts/, components/Search/, or the SpendOverTimeSection tree. The only boundary is app-wide (App.tsx:131), and React boundaries can't catch async rAF/setTimeout throws anyway.
The throw string lives only in canvaskit-wasm (MakeWebGLCanvasSurface: if(!n||0>n) throw "failed to create webgl context: err "+n;); it does not fall back to MakeSWCanvasSurface when the context is 0.
Alternative explanations considered: (a) A truly always-blocked GPU — already handled by the probe, so it wouldn't resurface. (b) getShaderPrecisionFormat returning null under memory pressure — that path returns false (empty state), so it's not the crashing path. The unguarded path is per-mount context-limit/allocation failure while the shared probe context stays valid, which fits the /search multi-chart aggravation and the "still 10 users/7d" tail.
What changes do you think we should make in order to solve the problem?
We can't force WebGL onto a machine that refuses it, so the goal is to stop the uncaught throw and degrade gracefully. In order of value:
Cap concurrent live Skia canvases / dispose on unmount (addresses the /search regression directly)./search re-mounts charts across insight tabs; ensure a chart's WebGL context is released when it leaves view and avoid keeping multiple Skia canvases alive at once, so the per-page context cap isn't exhausted. This removes the most common trigger of the new crashes.
Add a software-rendering fallback so CanvasKit stops throwing. A patch-package patch making the web renderer fall back to MakeSWCanvasSurface when GetWebGLContext returns 0 turns a fatal throw into a (slower) rendered chart. This is the only change that fully closes the async-throw gap, since neither try/catch nor an ErrorBoundary can catch it.
As defense-in-depth, suppress this specific known-benign error at the Sentry beforeSend/global handler (match failed to create webgl context) so it stops counting as a crash while the chart degrades on its own. This is a noise fix, not a root-cause fix — do it alongside 1/2, not instead.
Note the tension to respect: making the probe re-create a real per-mount context would catch more cases but reintroduces the context-churn false-negatives the current probe was written to avoid (isSkiaWebSupported.ts:8-10). Options 1+2 avoid that trap.
What alternative solutions did you explore? (Optional)
Tightening the probe to create/destroy a context per mount — catches more, but resurfaces the mobile false-negative regression the current code deliberately guards against.
Suppressing the Sentry event only — hides the symptom but leaves a silently missing chart; only acceptable as defense-in-depth (option 3).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97104) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Contributor: @wildan-m paid $250 via Upwork
Contributor+: @truph01 due $250 via NewDot
@wildan-m can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022081747685653182354
Activity
mountiny commentedon Jul 27, 2026
@wildan-m — please self-assign; automated assign failed (API could not add you). Carried forward from prior tracker #93834.
wildan-m commentedon Jul 27, 2026
@mountiny how to do that? self assign
mountiny commentedon Jul 27, 2026
Added you, seems like this events is still happening for users, can you take a look please?
MelvinBot commentedon Jul 27, 2026
Proposal
What is the root cause of that problem?
Charts on
/homeand/searchare drawn with Skia/CanvasKit, which asks the browser for a WebGL2 context and never falls back to software. When the browser can't hand one out — hardware acceleration off, GPU blocklisted, memory pressure, or the per-page WebGL context limit exhausted — CanvasKit throwsfailed to create webgl context: err 0. It throws from an async draw tick (requestAnimationFrame/setTimeout), so notry/catchand no ReactErrorBoundarycan catch it → it lands in Sentry (APP-7MV,auto.browser.browserapierrors.setTimeout).PR #94937 added a pre-mount WebGL2 probe (
SkiaWebChart/index.tsx:63) that shows an "Unable to display chart" empty state when WebGL2 is unavailable. That fixed the always-broken-GPU case, but the crash resurfaced because the probe can't see the failure that's actually happening now:isSkiaWebSupported.ts:8-10, returnstrueon a lost context at:35-36and on any exception at:39-40). That softening was intentional — to avoid hiding charts from capable mobile devices — but it means the probe passes while CanvasKit's separate, per-mount context creation can still fail./searchregression:/searchmounts/re-mounts several Skia canvases (Bar, Line, Pie across insight tabs, plus Home's chart may be alive) and can exhaust the browser's per-page context cap (~16 in Chrome). The single-context probe never trips this cap, so it green-lights a mount that then throws.Evidence chain (file:line)
SkiaWebChart/isSkiaWebSupported.ts—getContext('webgl2')at L21; its own header comment (L2-10) documents that it holds one context and returnstrueon ambiguous cases.SkiaWebChart/index.tsx:63.SearchChartView→SearchBarChart/Line/Pie →@components/Charts→SkiaWebChart. Home mounts it atSpendOverTimeSectionContent.tsx:88; Search atcomponents/Search/index.tsx:1015.ErrorBoundaryanywhere incomponents/Charts/,components/Search/, or the SpendOverTimeSection tree. The only boundary is app-wide (App.tsx:131), and React boundaries can't catch async rAF/setTimeoutthrows anyway.canvaskit-wasm(MakeWebGLCanvasSurface:if(!n||0>n) throw "failed to create webgl context: err "+n;); it does not fall back toMakeSWCanvasSurfacewhen the context is 0.Alternative explanations considered: (a) A truly always-blocked GPU — already handled by the probe, so it wouldn't resurface. (b)
getShaderPrecisionFormatreturning null under memory pressure — that path returnsfalse(empty state), so it's not the crashing path. The unguarded path is per-mount context-limit/allocation failure while the shared probe context stays valid, which fits the/searchmulti-chart aggravation and the "still 10 users/7d" tail.What changes do you think we should make in order to solve the problem?
We can't force WebGL onto a machine that refuses it, so the goal is to stop the uncaught throw and degrade gracefully. In order of value:
/searchregression directly)./searchre-mounts charts across insight tabs; ensure a chart's WebGL context is released when it leaves view and avoid keeping multiple Skia canvases alive at once, so the per-page context cap isn't exhausted. This removes the most common trigger of the new crashes.patch-packagepatch making the web renderer fall back toMakeSWCanvasSurfacewhenGetWebGLContextreturns 0 turns a fatal throw into a (slower) rendered chart. This is the only change that fully closes the async-throw gap, since neithertry/catchnor anErrorBoundarycan catch it.beforeSend/global handler (matchfailed to create webgl context) so it stops counting as a crash while the chart degrades on its own. This is a noise fix, not a root-cause fix — do it alongside 1/2, not instead.Note the tension to respect: making the probe re-create a real per-mount context would catch more cases but reintroduces the context-churn false-negatives the current probe was written to avoid (
isSkiaWebSupported.ts:8-10). Options 1+2 avoid that trap.What alternative solutions did you explore? (Optional)
Related issues
/home-only scope, paid/closed 2026-07-22. Fixed by PR Skip the Skia web chart when a WebGL2 context can't be created #94937 (probe). This issue is the resurfacing of the uncaught path that the probe doesn't cover.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97104)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Jul 27, 2026
Current assignee @truph01 is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jul 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022081747685653182354
19 remaining items
melvin-bot commentedon Aug 18, 2026
Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.
melvin-bot commentedon Aug 18, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 20, 2026
Payment Summary
Contributor: @wildan-m paid $250 via Upwork
Contributor+: @truph01 due $250 via NewDot
@wildan-m can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022081747685653182354
wildan-m commentedon Aug 22, 2026
@mallenexpensify accepted, thanks
mallenexpensify commentedon Aug 24, 2026
@wildan-m paid, summary updated above. Thx.
garrettmknight commentedon Sep 7, 2026
$250 approved for @truph01