Page MenuHomePhabricator

UploadWizard shows afterActive message during a campaign instead of whileActive
Open, MediumPublicBUG REPORT

Description

Steps to Reproduce:

  1. Set up an UploadWizard campaign with a start date in the past and end date in the future.
  2. Set both whileActive and afterActive messages.
  3. Go to UploadWizard with the created campaign.

Actual Results:

  • The afterActive message appears.

Expected Results:

  • The whileActive message appears.

Further Details:

  • The currently active Wiki Loves Folklore campaign exhibited this behavior before a hot fix.
  • The modifyIfNecessary function smells for me: if I understand the code right, both $cnf === 'whileActive' && $this->isActive() and $cnf === 'afterActive' && $this->wasActive() can be true at a given time, as wasActive does not necessarily mean that the campaign is already finished. This leads to essentially a race condition: whichever config key is iterated later, that wins.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 1 2020, 2:26 PM
MarkTraceur triaged this task as Medium priority.Jul 13 2020, 4:07 PM
MarkTraceur added a subscriber: MarkTraceur.

Likely a pretty small fix, so possibly something to hop on for a new contributor (though I'm loath to suggest tagging it as such, given the very limited amount of support for UploadWizard code review and whatnot right now)

@matthiasmullie can you take a look at this one? Thanks! Hoping to get this resolved by August to be ready for the Wiki Loves Monuments campaign.

I'm not sure I completely understand this issue.
If - as described - a campaign has a start date in the past and end date in the future, it's currently active (has already started, but not yet ended), right?
In such case, I would expect the whileActive message to be displayed, and afterActive shouldn't be displayed until the end date has reached.
Can anyone explain why it has to be the other way around, or where my understanding is wrong?

In such case, I would expect the whileActive message to be displayed, and afterActive shouldn't be displayed until the end date has reached.

I would also expect this, as I wrote in the Expected Results section. But actually afterActive appears during the campaign (or at least appeared when I reported this back in February), which I mentioned in the Actual Results section.

Oh, I somehow misread the order of actual & expected results, my apologies! I'll look into this!

Change 622311 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/UploadWizard@master] Don't let afterActive override whileActive

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

Change 622311 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Don't let afterActive override whileActive

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