Page MenuHomePhabricator

Source and preview getting out of sync on Firefox for Android (keyboard / GBoard app may be involved)
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):
Sorry, this one is pretty intermittent, may be hard to reproduce. Has happened to me around 5 times though.

  • Obtain an Android phone
  • Install Firefox for Android
  • Load en.wikipedia.org
  • Get out of mobile, get into desktop mode by clicking the "Desktop View" link in the footer, if needed
  • (Possible unnecessary step, haven't tested with this off yet) Turn your phone to landscape orientation.
  • (Possible unnecessary step, haven't tested with this off yet) Click on ... -> Desktop site -> yes
  • Make sure DiscussionTools is enabled
  • Visit a talk page and reply to a thread. In case it is page/wikicode dependent, here is a specific URL where it happened to me, when replying to the message that starts with "@Novem Linguae just want to make sure you saw this thread.": https://en.wikipedia.org/w/index.php?title=Template_talk:SPI_report&oldid=1072593207
  • Make sure you are in the Source tab, not the Visual tab
  • Type some stuff. Then backspace. Then click around to a new spot. Type some more stuff. Cut and paste a little.
  • Occasionally the preview box will get out of sync with the text box, requiring not submitting and doing a page refresh to fix.

What happens?:

  • Garbled preview text
  • Text box sometimes becomes unresponsive to some or all inputs
  • I think the reply button stops working too, but not sure, I will need to test more
  • Sometimes typing and copy/pasting will suddenly expose mangled wikicode in the text box that was previously hidden

2022-02-18 08.02.58.png (1×2 px, 167 KB)

2022-02-18 08.03.25.png (1×2 px, 115 KB)

What should have happened instead?:

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

  • enwiki MediaWiki 1.38.0-wmf.22 (529f223)
  • DiscussionTools 0.0.0 (902a389)
  • Firefox for Android 97.2.0 (Build #2015863827)

Event Timeline

hi @Novem_Linguae – we appreciate you reporting this issue. If you're able to detect a pattern in what causes this issue to surface, please let us know. Until then, we're going to hold off on looking into this issue.

ppelberg added a project: Editing-team.
ppelberg moved this task from Untriaged to This Fiscal Year on the Editing-team board.

I confirm this bug is still present. Had it happen today. It affects both the live preview and the rendered text.

https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:WikiProject_Articles_for_creation&diff=prev&oldid=1099437609

Bug still present as of Nov 22, 2023. Unfortunately, the subtask T312558: Google Keyboard input events can leave VisualEditor DM out of sync getting a patch didn't fix this.

Is a pretty bad bug. Using a combination of a large talk page and a long typed reply, the text slowly gets corrupted any time you press backspace or delete anything, then replace it with something else. The corruption can be silent and not noticeable until you post it sometimes.

One way to more easily test this is to do a bunch of typing, backspace, typing, etc. Then select all and cut your text. The cut may not match what you typed, and there may still be some text left in the preview box even though the text box is empty.

Some ideas for workarounds:

  • Do some testing to figure out exactly what environments this affects (is this a GBoard thing? is this a browser thing?). Then try turning off live previews for that environment and see if that works as a band aid fix. Better to have something off than to have it corrupted.
  • Try adding some kind of resync routine that recalculates the preview box, model, etc. from scratch based on the contents of the text box, run periodically somehow.
Novem_Linguae renamed this task from Source and preview getting out of sync on Firefox for Android to Source and preview getting out of sync on Firefox for Android (keyboard / GBoard app may be involved).Nov 22 2023, 10:10 PM

Adding @TK-999 since they wrote a patch for a similar issue in VE. Maybe they can provide some insights :)

Adding @TK-999 since they wrote a patch for a similar issue in VE. Maybe they can provide some insights :)

Thanks for the ping! These seem suspiciously similar to two bugs that our team fixed recently. I believe we were looking to upstream these:

These are generally input (ie Gboard) specific issues. For reproduction it's usually easiest to use an Android virtual device (e.g. via IDE integration) as simple in-browser mobile emulation won't cut it.

If it's useful, I frequently experience the same bug using Firefox on Android mobile (can't reproduce it today, but this has been nagging me for ages, I think the last time on November 25). I'm not using landscape or desktop mode.

Adding @TK-999 since they wrote a patch for a similar issue in VE. Maybe they can provide some insights :)

Thanks for the ping! These seem suspiciously similar to two bugs that our team fixed recently. I believe we were looking to upstream these:

Yes, please do upstream these :) If you could let us know when this happens in this ticket, I'd be happy to re-test after the patches are merged, to see if the bug goes away.

Do we think these VisualEditor patches will fix this issue in DiscussionTools? (i.e. does DT use the VE code for this?)