Skip to content

fix: Infinite loop with grid rendering#1631

Merged
mofojed merged 2 commits intodeephaven:mainfrom
mofojed:fix-grid-render
Nov 9, 2023
Merged

fix: Infinite loop with grid rendering#1631
mofojed merged 2 commits intodeephaven:mainfrom
mofojed:fix-grid-render

Conversation

@mofojed
Copy link
Copy Markdown
Member

@mofojed mofojed commented Nov 9, 2023

  • Caused by feat: Add ResizeObserver to Grid and Chart #1626
  • The children on IrisGrid were getting re-rendered as a result of IrisGrid.handleViewChanged getting called after updating the canvas in Grid.componentDidUpdate
  • Another fix would be to memoize metrics and not emit a view change if they are exactly the same as previous metrics, but thought that was a bigger change (need to deep equals a bunch of maps and arrays in the metrics)
  • Tested by opening up a table with React dev tools highlighting re-renders. Table did not re-render when not being interacted with.

- Caused by deephaven#1626
- The children on IrisGrid were getting re-rendered as a result of IrisGrid.handleViewChanged getting called after updating the canvas in Grid.componentDidUpdate
- Another fix would be to memoize metrics and not emit a view change if they are exactly the same as previous metrics, but thought that was a bigger change (need to deep equals a bunch of maps and arrays in the metrics)
- Tested by opening up a table with React dev tools highlighting re-renders. Table did not re-render when not being interacted with.
@mofojed mofojed requested a review from mattrunyon November 9, 2023 16:14
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 9, 2023

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (0a6965a) 46.70% compared to head (c01cb67) 46.66%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1631      +/-   ##
==========================================
- Coverage   46.70%   46.66%   -0.04%     
==========================================
  Files         589      591       +2     
  Lines       36355    36394      +39     
  Branches     9100     9108       +8     
==========================================
+ Hits        16978    16984       +6     
- Misses      19325    19358      +33     
  Partials       52       52              
Flag Coverage Δ
unit 46.66% <11.42%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/grid/src/Grid.tsx 64.54% <57.14%> (-0.14%) ⬇️
packages/utils/src/ObjectUtils.ts 0.00% <0.00%> (ø)
packages/utils/src/ObjectUtils.tests.ts 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread packages/utils/src/ObjectUtils.tests.ts Outdated
@mofojed mofojed requested a review from mattrunyon November 9, 2023 19:01
@mofojed mofojed merged commit 4875d2e into deephaven:main Nov 9, 2023
@mofojed mofojed deleted the fix-grid-render branch November 9, 2023 19:57
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants