#52758 closed defect (bug) (fixed)
5.7 About Page: Image comparison doesn't work on first load on some browsers
Reported by: | vladytimy | Owned by: | ryelle |
---|---|---|---|
Milestone: | 5.7.1 | Priority: | normal |
Severity: | normal | Version: | 5.7 |
Component: | Help/About | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
The image comparison script doesn't work on the first load of the page (after updating) - on some browsers. It works if page is refreshed.
First mentioned here by @joyously
The updating scenarios explored on Chrome & Edge
- 5.6.2 => 5.7 ==> Doesn't work
- 5.6.2 => 5.7 => 5.6.2 (rollback) => 5.7 ( all in the same browser) ==> Works!
- 5.6.2 => 5.7 => 5.6.2 (in browser A) & 5.6.2 => 5.7 (browser B) ==> Doesn't work!
- Fresh install of 5.7 (both local & on a server) /wp-admin/about.php ==> Works!
And now a strange thing (I'll accept if this can't be replicated, since I don't even understand how this can be) (everything in the same browser):
- 5.6.2 -> 5.7
- 5.7->5.6.2
- Clear cache, cookies, etc.
- 5.6.2 -> 5.7 ==> Works!
The updating scenario explored on Opera
- 5.6.2 => 5.7 ==> Doesn't work
The updating scenario explored on Firefox & Brave
- 5.6.2 => 5.7 ==> Works!
Also
- A diff checker between first load and 2nd load did not show anything (I thought about ?ver=x)
- Nothing comes up in the console
- The issues have been replicated locally & on 2 different servers
Maybe someone can see what's the problem trough the results above. At first I thought it might be cache related, then, it seems it's how browsers handle things. This is tricky because it needs to be caught at its first load in the browser. Would be nice to have a fix in 5.7.1 because that comparison block looks pretty nice!
Attachments (1)
Change History (11)
This ticket was mentioned in Slack in #core by vladytimy. View the logs.
4 years ago
#4
@
4 years ago
I use Firefox on Ubuntu Studio 20.04, and that test site is installed in a folder, not the root.
I don't see what difference the About page would have between the update redirect and the refresh once you're already there.
#5
@
4 years ago
- Focuses javascript added
I think I found out the source of the problem:
wp.domReady()
that controls the code handling the Image comparison doesn't behave properly in all browsers.
- If that function content is called in the console it works fine on the first load
- If that function is called by a
setTimeout()
instead, it works fine on the first load
so wp.domReady()
is most likely to be the source of the issue here
Now we need someone that knows how to fix that. I'll see if I find any documentation on how that works.
#7
@
4 years ago
I'm pretty sure this happens when one of the images is not fully loaded before the comparison script runs - it looks like domReady
runs when the page is loaded, not necessarily when all the assets are loaded. Switching to the window load event should wait until all resources are loaded.
#8
@
4 years ago
- Keywords has-patch added
Tested 52758.diff on
- Chrome 89.0.4389.82
- Edge 89.0.774.45
- Opera 74.0.3911.203
- Firefox 86.0
- Brave 1.21.76
on Window & Firefox 68.0.2 on Ubuntu
It works very nice, waiting until all resources are loaded.
Note: Read Incognito Window instead of Browser B (it was the same browser). Also, all tests above were made on Windows.