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-05-07] [$250] Report- Something when wrong when resize to fullscreen in bar or line view of expense report #87066
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.3.52-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85829 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 10 App Component: Other
Action Performed:
Precondition: Log in an account with many expense reports.
Go to reports tab
Select type:expense
Select group-by:merchant
Resize window in multiple times
Maximize the window
Result: Ocasionally when resizing to fullscreen app crashes
Expected Result:
When maximizing the window the app must run and display the content
Actual Result:
Ocasionally when resizing to fullscreen app crashes
Problem: The app crashes intermittently when resizing the browser window to fullscreen while viewing bar/line charts in the reports tab.
Root Cause: The crash is caused by a combination of two issues introduced in PR #85829:
Chart mount/unmount cycle during resize — Both BarChartContent.tsx:258 and LineChartContent.tsx:256 use {chartWidth > 0 && (<CartesianChart ...>)}. When the browser window resizes rapidly, chartWidth can momentarily hit 0 via onLayout, causing the entire CartesianChart (and all its Skia resources) to unmount and immediately remount. This intermittent teardown/rebuild is the trigger.
Unprotected Skia Paragraph API calls during render — buildChartParagraph (utils.ts:54-65) is called directly during render in ChartXAxisLabels.tsx:41-48, ChartYAxisLabels.tsx:38-43, and useChartLabelLayout.ts:54. These calls create Skia paragraph objects via Skia.ParagraphBuilder.Make() with no error handling. If the fontMgr or CanvasKit context is in a transitional state during the mount/unmount cycle, the native Skia call throws an unhandled exception that crashes the app.
Solution:
Replace the chartWidth > 0 conditional mount with a style-based approach (e.g., opacity: 0 or pointerEvents: 'none') so the CartesianChart stays mounted during resize transitions, avoiding the Skia resource teardown/rebuild cycle.
Add a try/catch around buildChartParagraph in utils.ts to gracefully handle Skia failures during transitional states, returning a fallback (null paragraph with width 0).
Optionally debounce the handleLayout callback in both BarChartContent.tsx:88 and LineChartContent.tsx to reduce the frequency of layout-triggered re-renders during rapid resize.
ChartXAxisLabels.tsx:41-48: Creates paragraphs for every label in the render body
ChartYAxisLabels.tsx:38-43: Same pattern
useChartLabelLayout.ts:54: measureTextWidth calls buildChartParagraph for every data point on each state change
Additional NaN/Infinity risk:
BarChartContent.tsx:135: calculatedBarWidth = ((1 - BAR_INNER_PADDING) * domainWidth) / data.length — if handleChartBoundsChange fires before early-return guard at line 248, data.length === 0 produces Infinity
Victory-native's CartesianChart.js:116-119: When size.width - padding.right < padding.left during resize, output window inverts and d3 scales can produce NaN values
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Report- Something when wrong when resize to fullscreen in bar or line view of expense report[/-][+][$250] Report- Something when wrong when resize to fullscreen in bar or line view of expense report[/+]on Apr 3, 2026
Please re-state the problem that we are trying to solve in this issue.
When the window is repeatedly resized and then maximized on Reports → Expenses (Bar/Line view), the app intermittently crashes and shows the “Uh-oh, something went wrong!” page.
From the attached video, the chart is visible during resize, and after several size transitions the app lands on the global error page.
What is the root cause of that problem?
Both chart implementations mount/unmount CartesianChart based on chartWidth > 0, while chartWidth is continuously driven by onLayout during window resizing. During rapid resize/maximize transitions, width can transiently cross zero/non-zero boundaries, causing repeated chart teardown/recreation.
This resize-driven remount cycle is the unstable part that aligns with the intermittent crash behavior captured in media.
What changes do you think we should make in order to solve the problem?
Remove chartWidth > 0 conditional mounting for CartesianChart in both Bar and Line chart components; keep charts mounted once data/font are ready.
Guard width-sensitive calculations and rendering with safe fallbacks (e.g., minimum width / no-op gesture math) rather than unmounting the whole chart tree.
If needed for visual polish, hide chart content with style (opacity or placeholder layer) while width is invalid, but avoid component teardown/recreation during resize.
Add regression coverage for rapid resize/maximize on web reports chart view to verify no crash and stable chart rendering.
What alternative solutions did you explore? (Optional)
Debouncing onLayout can reduce update frequency but does not remove mount/unmount churn by itself.
Wrapping more chart internals in guards helps, but the highest-impact fix is to stop full chart remounting on transient layout values.
Please re-state the problem that we are trying to solve in this issue.
The app intermittently crashes with "Something went wrong" when rapidly resizing or maximizing the browser window while viewing bar or line chart views in the reports tab.
What is the root cause of that problem?
The crash is caused by uncontrolled parent-driven re-renders cascading into the chart components during resize. SearchChartView (https://github.com/Expensify/App/blob/main/src/components/Search/SearchChartView.tsx#L46) is not memoized and creates a fresh handleItemPress callback on every render (line 52). Since it is a child of the Search component which re-renders on every window resize event (via useWindowDimensions → useResponsiveLayout), each resize frame triggers a full re-render cascade: SearchChartView → SearchBarChart (https://github.com/Expensify/App/blob/main/src/components/Search/SearchBarChart.tsx#L8) which creates new chartData and handleBarPress references each render (lines 10, 21) → down into the chart content. These parent-driven re-renders overlap with the chart's own layout-driven re-renders (from onLayout), creating a race condition where concurrent Skia CanvasKit paragraph operations corrupt the WASM module's internal state and throw an unhandled exception.
What changes do you think we should make in order to solve the problem?
We should memoize SearchChartView with React.memo and stabilize its internal callback with useCallback. Since its props (queryJSON, view, groupBy, data, isLoading) are all referentially stable during resize, this blocks the entire parent-driven re-render cascade from reaching the chart, leaving only the sequential layout-driven re-renders which don't race with each other.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
MelvinBot commentedon Apr 3, 2026
Proposal
Problem: The app crashes intermittently when resizing the browser window to fullscreen while viewing bar/line charts in the reports tab.
Root Cause: The crash is caused by a combination of two issues introduced in PR #85829:
Chart mount/unmount cycle during resize — Both
BarChartContent.tsx:258andLineChartContent.tsx:256use{chartWidth > 0 && (<CartesianChart ...>)}. When the browser window resizes rapidly,chartWidthcan momentarily hit 0 viaonLayout, causing the entireCartesianChart(and all its Skia resources) to unmount and immediately remount. This intermittent teardown/rebuild is the trigger.Unprotected Skia Paragraph API calls during render —
buildChartParagraph(utils.ts:54-65) is called directly during render inChartXAxisLabels.tsx:41-48,ChartYAxisLabels.tsx:38-43, anduseChartLabelLayout.ts:54. These calls create Skia paragraph objects viaSkia.ParagraphBuilder.Make()with no error handling. If thefontMgror CanvasKit context is in a transitional state during the mount/unmount cycle, the native Skia call throws an unhandled exception that crashes the app.Solution:
chartWidth > 0conditional mount with a style-based approach (e.g.,opacity: 0orpointerEvents: 'none') so theCartesianChartstays mounted during resize transitions, avoiding the Skia resource teardown/rebuild cycle.buildChartParagraphinutils.tsto gracefully handle Skia failures during transitional states, returning a fallback (null paragraph with width 0).handleLayoutcallback in bothBarChartContent.tsx:88andLineChartContent.tsxto reduce the frequency of layout-triggered re-renders during rapid resize.Supporting evidence
Mount/unmount cycle:
BarChartContent.tsx:258:{chartWidth > 0 && (<CartesianChart ...>)}LineChartContent.tsx:256: Same patternhandleLayoutatBarChartContent.tsx:88-90setschartWidthfromonLayout, which can report 0 during rapid window transitionsSkia paragraph creation during render (no error handling):
utils.ts:54-65:buildChartParagraphcallsSkia.ParagraphBuilder.Make()directlyChartXAxisLabels.tsx:41-48: Creates paragraphs for every label in the render bodyChartYAxisLabels.tsx:38-43: Same patternuseChartLabelLayout.ts:54:measureTextWidthcallsbuildChartParagraphfor every data point on each state changeAdditional NaN/Infinity risk:
BarChartContent.tsx:135:calculatedBarWidth = ((1 - BAR_INNER_PADDING) * domainWidth) / data.length— ifhandleChartBoundsChangefires before early-return guard at line 248,data.length === 0producesInfinityCartesianChart.js:116-119: Whensize.width - padding.right < padding.leftduring resize, output window inverts and d3 scales can produce NaN valuesNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Apr 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)[-]Report- Something when wrong when resize to fullscreen in bar or line view of expense report[/-][+][$250] Report- Something when wrong when resize to fullscreen in bar or line view of expense report[/+]melvin-bot commentedon Apr 3, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022040007211317396839
KJ21-ENG commentedon Apr 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When the window is repeatedly resized and then maximized on Reports → Expenses (Bar/Line view), the app intermittently crashes and shows the “Uh-oh, something went wrong!” page.
From the attached video, the chart is visible during resize, and after several size transitions the app lands on the global error page.
What is the root cause of that problem?
Both chart implementations mount/unmount
CartesianChartbased onchartWidth > 0, whilechartWidthis continuously driven byonLayoutduring window resizing. During rapid resize/maximize transitions, width can transiently cross zero/non-zero boundaries, causing repeated chart teardown/recreation.Bar chart conditional mount and resize handler:
App/src/components/Charts/BarChart/BarChartContent.tsx
Lines 71 to 73 in 1d43910
App/src/components/Charts/BarChart/BarChartContent.tsx
Lines 206 to 245 in 1d43910
Line chart uses the same pattern:
App/src/components/Charts/LineChart/LineChartContent.tsx
Lines 72 to 74 in 1d43910
App/src/components/Charts/LineChart/LineChartContent.tsx
Lines 265 to 303 in 1d43910
This resize-driven remount cycle is the unstable part that aligns with the intermittent crash behavior captured in media.
What changes do you think we should make in order to solve the problem?
chartWidth > 0conditional mounting forCartesianChartin both Bar and Line chart components; keep charts mounted once data/font are ready.opacityor placeholder layer) while width is invalid, but avoid component teardown/recreation during resize.What alternative solutions did you explore? (Optional)
onLayoutcan reduce update frequency but does not remove mount/unmount churn by itself.borys3kk commentedon Apr 3, 2026
Hello, this was most likely caused by my PR, I'm looking into it
trasnake87 commentedon Apr 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The app intermittently crashes with "Something went wrong" when rapidly resizing or maximizing the browser window while viewing bar or line chart views in the reports tab.
What is the root cause of that problem?
The crash is caused by uncontrolled parent-driven re-renders cascading into the chart components during resize.
SearchChartView(https://github.com/Expensify/App/blob/main/src/components/Search/SearchChartView.tsx#L46) is not memoized and creates a freshhandleItemPresscallback on every render (line 52). Since it is a child of theSearchcomponent which re-renders on every window resize event (viauseWindowDimensions→useResponsiveLayout), each resize frame triggers a full re-render cascade:SearchChartView→SearchBarChart(https://github.com/Expensify/App/blob/main/src/components/Search/SearchBarChart.tsx#L8) which creates newchartDataandhandleBarPressreferences each render (lines 10, 21) → down into the chart content. These parent-driven re-renders overlap with the chart's own layout-driven re-renders (fromonLayout), creating a race condition where concurrent Skia CanvasKit paragraph operations corrupt the WASM module's internal state and throw an unhandled exception.What changes do you think we should make in order to solve the problem?
We should memoize
SearchChartViewwithReact.memoand stabilize its internal callback withuseCallback. Since its props (queryJSON,view,groupBy,data,isLoading) are all referentially stable during resize, this blocks the entire parent-driven re-render cascade from reaching the chart, leaving only the sequential layout-driven re-renders which don't race with each other.In
src/components/Search/SearchChartView.tsx:trasnake87 commentedon Apr 3, 2026
Contributor details
Your Expensify account email: trasnake87@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010f770315ab181656
melvin-bot commentedon Apr 3, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
30 remaining items
DylanDylann commentedon May 4, 2026
@MelvinBot Could you find the PR that caused this issue?
MelvinBot commentedon May 4, 2026
The PR that caused this issue is #85829 ("Add paragraph api to skia") by
borys3kk, merged on 2026-04-02. This is confirmed by:borys3kk's own comment: "this was most likely caused by my PR, I'm looking into it"The fix was shipped in #87084, also by
borys3kk.melvin-bot commentedon May 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 7, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 8, 2026
Payment Summary
Contributor+: @DylanDylann due $250 via NewDot
quinthar commentedon May 30, 2026
Approved $250 to @DylanDylann