Closed kswenson closed 3 weeks ago
Attention: Patch coverage is 85.29412%
with 5 lines
in your changes missing coverage. Please review.
Project coverage is 84.79%. Comparing base (
46787cf
) to head (7eaa312
). Report is 2 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
v3/src/components/axis/hooks/use-sub-axis.ts | 86.66% | 4 Missing :warning: |
...3/src/components/axis/helper-models/axis-helper.ts | 0.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Project | codap-v3 |
Status | Passed |
Commit | 12fe766989 |
Started | Aug 18, 2024 5:23 PM |
Ended | Aug 18, 2024 5:32 PM |
Duration | 08:19 💡 |
OS | Linux Ubuntu - |
Browser | Chrome 127 ![]() |
![]() |
cypress/e2e/bivariate-adornments.spec.ts ![]() |
1 ![]() |
|
---|---|---|---|
1 | Graph adornments > adds squares of residuals squares to the plot when the Squares of Residuals checkbox is checked |
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud
👍🏻LGTM This PR appears not only to have fixed the MST warnings issue but also to have fixed the problem I observed when switching attributes in a scatterplot. Cool. (I'll be asking you about that!)
I didn't see the infinite loop behavior you described after I fixed the first issue with the helper confusion, so I assume it was another symptom of using a stale helper. 🤷
[PT-188130687]
The
useSubAxis
hook makes use of anAxisHelper
instance, which was being created/stored in a local variable usinguseMemo()
. When transitioning from an empty axis to a date axis, a MobX reaction withinuseSubAxis
was being triggered before theuseSubAxis
hook was re-rendered to update the axis helper instance, which meant that a stale axis helper connected to a defunct axis model was being called.Instead of storing the axis helper instance in a local variable we now store it in a WeakMap keyed by the
AxisModel
, and look it up when needed so that the axis helper used will always be the one associated with the correct axis model. Because it's aWeakMap
, axis helpers associated with defunct axis models will automatically be garbage-collected, so we don't need to worry about cleanup.Separately, there was another reaction in the
useAxis
hook which was turned into amstReaction
to avoid another MST warning on destruction of the axis model.