Page MenuHomePhabricator

Attempting to add a qualifier and then cancelling leaves a "trace" behind
Closed, ResolvedPublicBug

Description

On the File page, going through the steps to add a new Qualifier to an existing statement, and then aborting that step, leaves behind a visible trace on the page.

Steps to Reproduce:

  1. Go to a File page and view the Structured Data tab. This bug is viewable on both BetaCommons and on master. Using a Statement Panel which already contains one or more statements will make this easier to see.
  2. Toggle a Statement panel into edit mode, and click the "Add Qualifier" button
  3. Do not actually submit a new qualifier; instead, click the Cancel button.
  4. (optional): Repeat this an arbitrary number of times.

Actual Results:

Each time the user toggles the qualifier input UI and then cancels it, something is left behind that confuses the panel. These "ghost qualifiers" were never submitted to the server and have no content... but you can see them.

In Read mode, you can see one "ghost qualifier" for each cancelled attempt that was made (note the little lines and weird spacing):

In Edit mode, the ghost qualifiers come back with a vengeance, and show up as full (empty, disabled) rows. They are there from the moment the panel becomes editable and persist between mode switches:

Expected Results:

If the user clicks "add qualifier" but then cancels without submitting new data, the DOM should revert to the same state that it was in before when it returns to read mode. If the user toggles back into edit mode again at this point, there should be no extra empty input rows visible.

Event Timeline

Restricted Application added a project: Multimedia. · View Herald TranscriptMay 30 2019, 12:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Ramsey-WMF triaged this task as Normal priority.May 30 2019, 12:53 AM
Ramsey-WMF moved this task from Untriaged to Next up on the Multimedia board.
Ramsey-WMF moved this task from To Do to Doing on the SDC Engineering board.Jun 3 2019, 11:17 PM

Change 514263 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Make sure statements always get fed the new data

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

Change 514263 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Make sure statements always get fed the new data

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

Edtadros reassigned this task from Edtadros to Cparle.Thu, Jun 20, 12:32 AM
Edtadros added a subscriber: Edtadros.

Test Result

Status: ❌ FAIL
OS: macOS Mojave
Browser: Chrome
Device: MBP

Test Artifact(s):

QA Steps

Note: I tested this on test commons: https://test-commons.wikimedia.org/wiki/File:Cat_with_headphones.gif

  1. Go to a File page and view the Structured Data tab.
  2. Toggle a Statement panel into edit mode, and click the "Add Qualifier" button
  3. Do not actually submit a new qualifier; instead, click the Cancel button.

❌ AC1: Ghost qualifiers can be seen in the gif below.

Change 517976 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@wmf/1.34.0-wmf.8] Make sure statements always get fed the new data

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

Looks like testcommons also got rolled back, so the failure is ok - the fix isn't there anymore. Let's test again next week :)

Change 517976 merged by Matthias Mullie:
[mediawiki/extensions/WikibaseMediaInfo@wmf/1.34.0-wmf.8] Make sure statements always get fed the new data

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

matthiasmullie closed this task as Resolved.Thu, Jun 20, 11:20 AM

This fix was now backported to the currently deployed branch.
This works.