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
Hide loading errors when user changes reporting page #17292
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 this makes it at least a bit better. But there are still some cases where an error message might be shown, that is unrelated. e.g. when you load a report page that sends xhr requests to fetch additional data. But before those requests were answered you already switch to another report page. If an old request then fails, the error message will be show even if it actually was for the page before. Guess that won't be that easy to fix, as we need some mechanism to automatically cancel xhr requests that aren't needed anymore (or at least ignore possible errors). Maybe we could store the url that was related to an XHR when it is sent or something similar. But guess that's something for another PR. ping @tsteur
@sgiehl @tsteur luckily our matomo/plugins/Morpheus/javascripts/ajaxHelper.js Lines 44 to 58 in 5e2c5dc
So I added one more line to call this method on every reporting page load. I tested it locally and it did the job. |
This might also be related to #10578 |
@Findus23 yes, there is a chance it solves that as well. I try to reproduce the other issue without the modifications and then with this PR. Update: I see now, the other issue is different. In this PR we just abort the ajax requests when we change reporting page. The other issue happens with a full page reload: the new page starts loading but the browser still shows the original page, which has an error now, because the request are not loading anymore. |
I updated the PR, because I find out where is that error on dashboard coming from #10578. |
I haven't tested this yet, but for the second issue, would it also work to cancel ajax requests in the window's |
Hi @diosmosis, I modified the PR. Instead of using a timeout, I'm checking if the |
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.
Played around with failing requests locally, but it seems the error message now is only shown if the error really affects the current page. Guess this would be good to merge now 👍
Description:
fixes #17104
fixes #10578
Review