Page MenuHomePhabricator

[BUG] Article content removed the second time a user closes the tool
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When you close the WhoWroteThat tool for the second time, all the content is removed from the article.

To speculate wildly, I think it is possibly related to the use of the replaceWith() function in App.js:onWidgetClose(). replaceWith() removes the object from the DOM. When replaceWith() is called a second time on the same object (which has previously been removed), it does not have the same affect.

This bug was found by @Mooeypoo.

Steps to reproduce problem

Install the extension using the instructions.

  1. Go to any article
  2. In the sidebar, click "Who Wrote That?"
  3. Once the tool has loaded, on the infobar at the top click the close icon
  4. Click "Who Wrote That?" again
  5. Click the close icon again

Expected behavior: Tool is closed. Article returns to normal.
Observed behavior: Article content is removed.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 28 2019, 8:12 AM
Samwilson claimed this task.Sep 6 2019, 4:44 AM
Samwilson added a subscriber: Samwilson.

This bug was annoying me while working on T231359, so:

https://github.com/wikimedia/WhoWroteThat/pull/46

I can no longer reproduce the original bug, even if closing and opening the tool multiple times.

The fix affects how the extension restores the original HTML after closing.

Therefore, I chose a random page from each supported wiki and compared the HTML before the extension was opened and after it was closed.

The original HTML is not completely restored, due to several known and reported bugs (e.g. T232131 and T231424) which are unrelated to this change.

Therefore, I don't believe there is anything more to do for this bug.

ifried added a subscriber: ifried.Sep 10 2019, 10:38 PM

@dom_walden I was able to reproduce the bug on English Wikipedia. Should I be testing on some other environment?

@dom_walden I was able to reproduce the bug on English Wikipedia. Should I be testing on some other environment?

:O. Are you using @Mooeypoo's gadget? I think that is a bit out of date now (last updated on 10th August).

ifried closed this task as Resolved.Sep 12 2019, 6:42 PM

Thanks for the clarification. I tested with the updated version, and the bug is fixed.