Closed rod-glover closed 1 month ago
Currently deployed production version behaves correctly, for comparison.
if you wish to see incorrect behaviour, clone the repo and check out commit d5c98752 / "Merge pull request #107 from pacificclimate/misc-fixes", then start app locally
Note: I think the upgrade to React 18 may have introduced some different, more "careful" behaviour by React with keys on rendered components. Which meant a shortcoming suddenly became visible a little while ago in my work. This is as well to know for other projects.
So the demo and the production version both behave correctly? The error was introduced in a version that has not yet been deployed to production, and thankfully caught early?
So the demo and the production version both behave correctly? The error was introduced in a version that has not yet been deployed to production, and thankfully caught early?
Yes, thank goodness. Earlier, I thought not.
Took me a while to understand the actual problem, but here's an example from SE BC, running the d5c9875 version:
Start at April 2024:
Click backwards to March 2024:
Click backwards ti February 2024:
Now click forward to return to March 2024, but notice the colour coding of the stations is different than when we previously viewed March 2024. Perhaps it is retaining the February 2024 coloration?:
Click forward to return to April 2024, which again does not match the previous viewing of this data:
I have confirmed this behavior does not occur in the above-linked demo.
Excellent, thank you both!
Resolves #108 Resolves #109
This is an important fix; without it data is displayed inconsistently and wrongly.
Erroneous behaviour was that going back a few months (one at a time, with the -1) control and then moving forward again showed inconsistent (not the same!) markers.
Fix: Now consistent. Reviewer should verify; I can provide support for that.