Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Infinite loop with grid rendering #1631

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

mofojed
Copy link
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
Copy link

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.

@mofojed mofojed requested a review from mattrunyon November 9, 2023 19:01
@mofojed mofojed merged commit 4875d2e into deephaven:main Nov 9, 2023
5 checks passed
@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