Page MenuHomePhabricator

Blank realtime preview pane when request times out
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

What is the problem?

In some circumstances, if the reload request times out the realtime preview pane is blank (showing only the manual reload bar, see screenshot).

This appears to happen only if the timeout occurs after I have already successfully reloaded the preview 3 times. (I believe the code has some logic which means it behaves differently after the first 3 reloads, see T304568.) It doesn't happen if your first reload times out.

So, for example, if I have a generally good connection but it drops out for a short period I might experience this bug.

It is recoverable though. If you reload the page again you will see either the normal error message ("Preview not loading") or the preview will display successfully with the manual reload bar appearing (if your connection has returned).

Steps to reproduce problem
  1. Login to beta as a user with RTP enabled
  2. https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Cat&action=edit
  3. Reload the realtime preview 3 or more times
  4. Open the devtools and throttle the connection as much as you can (disconnecting from the internet might work)
    • This is easier with Firefox as you can set your connection to "GPRS" which I find does the trick. With Chrome, you have to create a custom profile.
  5. Reload the realtime preview again

Expected behavior: The request times out and you see a nice error message such as in T303383.
Observed behavior: The realtime preview pane is blank.

Environment

Browser: Firefox 91, Chromium 87
Wiki(s): https://en.wikipedia.beta.wmflabs.org and local docker MediaWiki 1.39.0-alpha (1eb3596) 05:55, 27 April 2022.
Editor: WikiEditor 0.5.3 (0e1ca81) 06:08, 27 April 2022.

Screenshots

rtp_pane_blank.png (839ร—1 px, 142 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptApr 27 2022, 9:07 AM
JMcLeod_WMF set the point value for this task to 3.Apr 27 2022, 11:23 AM
JMcLeod_WMF moved this task from New & TBD Tickets to Estimated on the Community-Tech board.
JMcLeod_WMF moved this task from Estimated to New & TBD Tickets on the Community-Tech board.
MusikAnimal set the point value for this task to 3.Apr 27 2022, 11:32 AM

Another way I have found to reproduce this. If the realtime preview times out the 3rd request of the session. E.g.:

  1. Open an edit session and make sure the preview is closed
  2. Reload the page (the whole page, not just RTP)
  3. When the page loads, throttle your connection so it will time out
  4. Open realtime preview
  5. When you see the timeout message, reload
  6. When you see the message again, reload again
  7. RTP pane is blank

Change 787839 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/WikiEditor@master] Realtime Preview: always re-show preview area

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

@dom_walden I'm unable to reproduce this. Is it still an issue?

@dom_walden I'm unable to reproduce this. Is it still an issue?

I can reproduce it pretty regularly. Perhaps I need to do a video demonstration.

I think I've figured this out. We're hiding the error message whenever entering manual mode, but actually should be doing so only on successful preview. i.e. I'd been thinking that we wouldn't want the error and manual bar to show at the same time, but that's actually valid.

@dmaza I can replicate it by adding the following at the top of ApiParse::execute(), and then reloading the preview three times:

sleep( ( $this->getConfig()->get('WikiEditorRealtimeDisableDuration') + 1000 ) / 1000 );
throw new \Exception( 'testing' );

Change 787839 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Realtime Preview: show and hide preview and error areas appropriately

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

I haven't been able to reproduce this bug.

I have been recording the reproduction steps each time I saw this bug over the last 1-2 weeks. I repeated all of those and could not reproduce.

Test environment: https://en.wikipedia.beta.wmflabs.org WikiEditor 0.5.3 (be4ee22) 00:23, 6 May 2022.

NRodriguez added a subscriber: NRodriguez.

Will mark as resolved since not able to reproduce