[go: nahoru, domu]

Page MenuHomePhabricator

SDC: When using the back button, recently added captions sometimes don't display in Chrome
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Add an English caption
  2. Click on the page's View History tab
  3. Observe that the addition of the caption shows up in the revision history
  4. Click the browser's back button
  5. See if the caption you just added shows up on the page

Note: clicking Refresh resolves the issue

See the GIF below for further clarity:

angel.gif (471×902 px, 3 MB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I can't reproduce this in FF or chrome ...

When the gif begins I see the default text for the English caption, rather than the caption that the history page shows. Did you add the caption in a different window?

Added the caption in the same window. I just tried it again and it happened reliably. Try:

1.) add caption

2.) click View History

3.) Hit back button

If that doesn't work, try doing it in incognito/private mode

The GIF starts with the default text because I'd already added the text, viewed the history, and hit back before I started recording it :)

Updated bug notes:

  • So far, the bug seems to be specific to Chrome on Windows
  • Tested on multiple computers
  • Bug was seen on both old and latest versions of Chrome

I can reproduce it on Chrome on Windows too ... (now how to debug it :/ )

Jdforrester-WMF renamed this task from Beta Commons: When using the back button, recently added captions don't display to SDC: When using the back button, recently added captions don't display, but only in Chrome on Windows(?).Nov 9 2018, 5:01 PM
Jdforrester-WMF updated the task description. (Show Details)

Per Cormac, this looks like a bfcache Chrome 'bug'/optimisation we'll need to work around.

@Ramsey-WMF I can't reproduce this on windows anymore, on labs or on beta. I wonder has something else fixed it somehow?

Whoa hang on ... *now* I can reproduce it

/me continues

Cparle renamed this task from SDC: When using the back button, recently added captions don't display, but only in Chrome on Windows(?) to SDC: When using the back button, recently added captions sometimes don't display in Chrome.Nov 13 2018, 5:52 PM

Ok I've finally managed to reproduce this in Chrome on mac, but it's intermittent (also intermittent on Windows, it turns out)

Trying to diagnose using chrome developer tools I've found that if the File page is loaded from the disk cache (i.e. it says (from disk cache) in the 'size' column in the 'network' tab in dev tools) then it won't show the most recently added languages. If it shows a size in kb then it will

I haven't figured out why the page is sometimes written to the disk cache and sometimes not

(doesn't happen in other browsers cos they have an actual bfcache, and no requests are made when you click back)

Change 473573 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/WikibaseMediaInfo@master] Prevent caching of page for 'back' button in Chrome

https://gerrit.wikimedia.org/r/473573

Change 473573 abandoned by Cparle:
Prevent caching of page for 'back' button in Chrome

https://gerrit.wikimedia.org/r/473573

Change 474289 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/WikibaseMediaInfo@master] Refresh captions and revision id before making editable

https://gerrit.wikimedia.org/r/474289

@Ramsey-WMF

The only way I've found to (apparently reliably) prevent chrome reading from its cache when the user clicks 'back' is to rewrite the URL on the File page so that it has a random parameter appended to it. Neither @Jdforrester-WMF nor @MarkTraceur think this is a good idea

The latest patch refreshes the data when the user clicks 'edit'. Not exactly what you want, but it's an improvement (though it does come with a speed/responsiveness cost).

Change 474289 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] CaptionsPanel: Refresh captions and revision id before making editable

https://gerrit.wikimedia.org/r/474289

The half-way solution (refresh captions on edit) has landed. Note that showing the caption panel in a disabled state hasn't done so though yet.

We're accepting that the main problem is not fixable right now, and the halfway solution is Cormac's suggestion of refreshing the captions when the user clicks on the edit button. I've tested that on Beta and confirm that it works.