-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 loading saved insights #7451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess 2 is more than 0. Math definitely checks out. But is there no way to get to 1? This feels like a quick fix without fully untangling the cause.
What route is causing it to load twice? Could adding "if we really didn't do anything by now, just yolo call setFilters
here" to the end of urlToAction help?
However, again, 2 > 0, so if this fixes a real issue and doesn't introduce any timing-related edge cases due to the double queries, nor cause too much extra load, I'd be happy to approve. That said, a test is failing. This insight data loading is a very delicate and fragile area, so I tried to have as many cases covered by tests as possible.
PS. You said #7439 twice.
Oops, here's the correct issue: #7411 |
I guess my main insight 🥁 🕶️ ... is that all of this is so flakey, that it's worth investing heavily in tests 😅. |
39fe53c
to
640a0ad
Compare
I spent an inordinate amount of time trying to get to almost exactly 1 results loading always but it's hell to patch every edge case that the current shape of the logic creates. Many actions can directly or indirectly lead to the URL changing, which can lead to those actions… and guards that are in place to prevent these actions from going into a loop are really hard to nail in a way where things load always, but never more times than needed. |
Changes
Fixes #7439Fixes #7411. This is similar to #7439 in that the problem here, like there, issetFilters
being fired alongsideloadInsight
in some cases… and in some not – and both can fireloadResults
, while we want to avoid fetching results any number of times other than 1 (0 is unacceptable, 2 as well though not that bad). Any suggestions from your side @mariusandra having refactored a lot of this recently?How did you test this code?
TODO