User tests: Successful: Unsuccessful:
@dgrammatiko 3 years ago in #21421 you continued added a 2000ms delay in checking for Joomla updates when you refactored. Can you remember why waiting that long?
It now "feels" that its slow checking for updates now, when sat along side the other boxes in Joomla 4 admin that are also running an ajax call checking for udpates - its not slow, because its not actually checking until 2000ms after page load, and then returns very fast once the ajax call is finally made.
This PR is me pretending to be a javascript developer so if its wrong I'll happily let you do it, I compared it to the other boxes checking for updates and they dont have a setTimeout
Load home dashboard - watch the four green boxes for updates.
same as before, just much (2000ms) faster.
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Labels |
Added:
NPM Resource Changed
?
|
Done. Thanks.
I have tested this item
I have tested this item
I have tested this item
It would be good to find the reason that the delay was placed there in the first place before removing it
It would be good to find the reason that the delay was placed there in the first place before removing it
da59378#diff-d9892566784491318da9dfec14b617f12198d73377796009002b2931f5842b34
no reason found
no reason found
Correct. Just one guys way of writing code.
Status | Pending | ⇒ | Ready to Commit |
RTC
It would be good to find the reason that the delay was placed there in the first place before removing it
FWIW the code is asynchronous, which means it will not block anything happening in the page rendering phase so if the fetch of the json happens immediately or after 2 seconds it's irrelevant as it will most probably take also around .5~1sec to get the response.
it will most probably take also around .5~1sec to get the response.
That is, if it doesn't actually check for updates, as it is cached out of the time. If it actually has to ask joomla.org for the latest information it will take considerably longer. This is what I thought it was doing when it was taking so long today.
If it actually has to ask joomla.org for the latest information it will take considerably longer
It always do that. I had proposed to have some sort of state store in session storage but people were against it for some reasons that I can't recall rn
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-05-09 17:50:05 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
?
|
Thanks!
@PhilETaylor I have no clue, that PR was just converting the notation from ES5 to ES6, so I probably respected what was there
May I propose this version of the script, since you're refactoring it here: