Last modified: 2014-09-09 17:21:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66685, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64685 - Template used as campaign headerLabel is cached unwantedly
Template used as campaign headerLabel is cached unwantedly
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-30 22:47 UTC by Romaine
Modified: 2014-09-09 17:21 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Romaine 2014-04-30 22:47:36 UTC
Today Wiki Loves Earth started, a big project similar to Wiki Loves Monuments. Above the upload wizard when users use the wizard to upload through a specially created campaign, above it they see a banner which shows if the campaign has started, running or finished. As Wiki Loves Monuments had more than 100 campaigns, this switch we made automatically to make sure uploads are excluded when they are uploaded outside the contest period and to make sure that participants see information on top that they know they can upload or have to wait if they want to participate.

Today we noticed that the automatic switch we built in with a template is not working as it did before, template is not changed in the way it works. We had to do null edits on all campaigns to make the campaigns show the correct banner.

Please let the campaigns not be cached, just as before, so that users will be able to see the actual banners above it. Thanks.


(I am the maintainer of campaigns for Wiki Loves Earth and Wiki Loves Earth, the largest photo competition in the world.)
Comment 1 Andre Klapper 2014-05-01 15:26:48 UTC
(In reply to Romaine from comment #0)
> Today we noticed that the automatic switch we built in with a template is
> not working as it did before, template is not changed in the way it works.

Link to template welcome.
Comment 2 Romaine 2014-05-01 23:51:02 UTC
The current template is https://commons.wikimedia.org/wiki/Template:Wiki_Loves_Earth_is_running

This template is identical in structure of https://commons.wikimedia.org/wiki/Template:WLM-is-running - the template we used for Wiki Loves Monuments in more than 100 campaigns in both 2012 as 2013, both editions it worked fine.
Comment 3 Gilles Dubuc 2014-05-08 16:38:51 UTC
Confirmed locally. When the template doesn't exist UploadWizard shows a red link, when the template is created, UW picks it up, but when the template is updated, UW still displays the old version.
Comment 4 Gilles Dubuc 2014-05-08 16:44:47 UTC
Caching was introduced here: https://gerrit.wikimedia.org/r/#/c/86960/

The commit message suggests that there's supposed to be a job-based invalidation.
Comment 5 Gilles Dubuc 2014-05-08 17:05:13 UTC
OK, I think I've figured it out. Basically that caching was introduced and it has a couple of limitations, which I don't think we can avoid:

The link between the campaign and the templates it uses will only be created if you create or save the campaign while the template exists. If you create the campaign before the templates it references, the connection won't be made and subsequent updates to the template won't get picked up. The workaround is to re-save the campaign once you've created the template. That create the link between the two and any subsequent update of the template will update the campaign.

Secondly, the parent template (in this case https://commons.wikimedia.org/w/index.php?title=Template:Wiki_Loves_Earth_is_running ) needs to be saved in order for the update to trickle down to the template. That's a single save to update all the campaigns though. This is what you used to have, right?

Lastly, the update that trickles down to the campaigns runs through a job, so it won't be immediate. I don't know what the job queue on Commons is usually like, but it could be seconds, minutes, or hours depending on the job queue at the time of the template update.

Does that all make sense? I imagine you either ran into the red link issue (referencing templates before they exist) or the fact that the update is asynchronous. As for this caching, I imagine it was introduced for performance reasons.
Comment 6 Gilles Dubuc 2014-05-08 17:06:21 UTC
And by the way I've verified that the update/invalidation works correctly on my local install.
Comment 7 Romaine 2014-05-14 22:42:22 UTC
I do not think this describes the experienced problem. (We do not have a red link issue.) On top of the campaign, we want to be able to show a banner if the campaign has not started yet, a banner for if it is running or a banner if it has ended.

With Wiki Loves Monuments we had about 100 campaigns we had to start. To prevent errors and to lighten the workload, we introduced in 2012 a timer template. This timer template automatically changes the banner (before, during or after) at certain points in time: when the contest starts or ends. This worked perfectly in both 2012 and 2013. Users see the banner and think: ok, now my uploads are eligible or not.

Now with Wiki Loves Earth, we use exactly the same set-up and now it doesn't work any more. When the point of time is reached that a contest starts/ends, the campaign shows the previous banner template instead of the actual banner. (Previous it showed the actual banner.)

Only when we did a null edit on every campaign, the right banner was shown.
Comment 8 Romaine 2014-05-14 22:47:00 UTC
This problem of not showing the actual banner caused a lot of confusion at the beginning of this month and a lot of users reported this problem to us, it is an essential part of the infrastructure of contests.

Wiki Loves Monuments is coming again in September with many campaigns, also at the end of this month and a month later this is a problem.
Comment 9 Gilles Dubuc 2014-05-15 07:01:25 UTC
You'll need to re-save the template and the changes should trickle down. The caching introduced at the end of last year was probably introduced as an operational necessity, I imagine that the lack of caching was inefficient. That sort of thing is rarely introduced for frivolous reasons, in all likelihood it means that the old cache-less technique was a strain on servers.

The caching is what's preventing the time-based template from updating automatically. Re-saving each campaign shouldn't be necessary, just re-saving the common template should do the job. That sounds like a reasonable workaround to me. The automatic time-based conditions won't work (since you have to re-save the template anyway), but at least there's only one template to update for all campaigns. Thus it scales to any amount of campaigns running at the same time. I agree that having to re-save all campaigns would be a major inconvenience and time sink, but it's not necessary (granted, once again, that the template existed the last time the campaigns were saved).

The issue of having to re-save the template at a specific time remains the only inconvenience, but it's a side-effect of the caching that I think can't be worked around easily. I'm not very familiar with templates, could you show me what rules/syntax are used for the time-based stuff? This way I could investigate how they work and if there's any chance the campaigns could support them better. I'm not very hopeful at this point, though, I think it's quite likely that this limitation is going to be impossible to avoid.
Comment 10 vriullop 2014-05-15 07:48:28 UTC
(In reply to Gilles Dubuc from comment #9)
> You'll need to re-save the template and the changes should trickle down.

I tried to re-save the template but it did not work after Romaine re-saved each campaign. Probably a campaign should have a definition for starting and ending time to manage it correctly avoiding a trick with templates.
Comment 11 Gilles Dubuc 2014-05-15 11:15:20 UTC
Yes, that sounds like a much better idea. Basically define the start and end date in the campaign settings, and have optional content/template settings to display before, during and after. I'll file it as a task.
Comment 13 Romaine 2014-05-30 13:50:42 UTC
Can this bug me solved soon or do we have the do nulledits on all the campaigns at the end of this month and again twice for Wiki Loves Monuments at the begin and end of September? (about 100 campaigns!!)
Comment 14 Gilles Dubuc 2014-06-02 07:15:18 UTC
Since the Multimedia team is now focusing on UploadWizard for at least 2 quarters, we should find time to implement this feature at some point this summer, in time for Wiki Loves Monuments.
Comment 15 Romaine 2014-06-09 06:02:46 UTC
I hope the Multimedia team is interested in the ideas of the UploadWizard from the users who use them?
Comment 16 Romaine 2014-06-09 06:04:17 UTC
(In reply to Gilles Dubuc from comment #11)
> Yes, that sounds like a much better idea. Basically define the start and end
> date in the campaign settings, and have optional content/template settings
> to display before, during and after. I'll file it as a task.

If that solves the caching of the campaign, it sounds fine to me. I am willing to implement it to all relevant campaigns if it works. Please contact me when it is tested in an example campaign.
Comment 17 Gerrit Notification Bot 2014-08-13 17:03:10 UTC
Change 153818 had a related patch set uploaded by MarkTraceur:
Add start/end and whileActive to the campaigns

https://gerrit.wikimedia.org/r/153818
Comment 18 Mark Holmquist 2014-08-13 17:06:22 UTC
I think this patch will just about do the trick.
Comment 19 Gerrit Notification Bot 2014-08-20 20:14:05 UTC
Change 155351 had a related patch set uploaded by MarkTraceur:
Add beforeActive and afterActive to campaigns

https://gerrit.wikimedia.org/r/155351
Comment 20 Gerrit Notification Bot 2014-08-26 19:02:29 UTC
Change 153818 merged by jenkins-bot:
Add start/end and whileActive to the campaigns

https://gerrit.wikimedia.org/r/153818
Comment 21 Gerrit Notification Bot 2014-08-26 19:02:34 UTC
Change 155351 merged by jenkins-bot:
Add beforeActive and afterActive to campaigns

https://gerrit.wikimedia.org/r/155351
Comment 22 Gerrit Notification Bot 2014-08-27 21:03:40 UTC
Change 156692 had a related patch set uploaded by MarkTraceur:
Add start/end and whileActive to the campaigns

https://gerrit.wikimedia.org/r/156692
Comment 23 Gerrit Notification Bot 2014-08-27 21:06:25 UTC
Change 156692 merged by jenkins-bot:
Add start/end and whileActive to the campaigns

https://gerrit.wikimedia.org/r/156692
Comment 24 Gerrit Notification Bot 2014-08-27 21:06:33 UTC
Change 156694 had a related patch set uploaded by MarkTraceur:
Add beforeActive and afterActive to campaigns

https://gerrit.wikimedia.org/r/156694
Comment 25 Gerrit Notification Bot 2014-08-27 21:07:14 UTC
Change 156694 merged by jenkins-bot:
Add beforeActive and afterActive to campaigns

https://gerrit.wikimedia.org/r/156694
Comment 26 Mark Holmquist 2014-09-09 17:20:37 UTC
I believe the two patches fix this issue. If there are further caching issues with the campaign contents, let us know and we can reopen. :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links