Page MenuHomePhabricator

The functionality for "days left until" is not working correctly with parsoid
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to this Wikipedia page and look for the number of days left until the event starts. It can be found in the information box to the right, at the beginning of the page.
  • Change mode to "edit", now it has maybe changed.
  • Change mode to "edit wikitext" and then return to "read" or "edit", now it also may have changed.
  • Exit the page and return, same here.
  • I could not find a pattern for when it is showing the correct number of days or not, or even when it changes or not. More info below.

What happens?:

I found the problem in the info box at this Wikipedia page. More specifically at "Invigning 6 februari 2026 (om XXX dagar)". The XXX indicates where the number of days until the mentioned date will occur. What is written out instead of XXX is changing when I'm changing mode (read, edit etc.), if I reload the page or re-enter the page. I found no pattern of when it is showing the correct number of days or not, it is seemingly random. Both on my laptop and smartphone (only tried through browsers, no app).

What should have happened instead?:

The correct number of days should have been written out all the time and not change no matter what I do.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

For reference in the following images, there are 99 days and ~3 hours left until the 6th of February, so I guess 100 days is the correct one.

Skärmbild 2025-10-29 202320.png (177×520 px, 34 KB)

Skärmbild 2025-10-29 202249.png (173×485 px, 33 KB)

Skärmbild 2025-10-29 202536.png (178×501 px, 34 KB)

Event Timeline

Umherirrender subscribed.

Sounds like cached pages. The wikitext is not parsed on each page view, as that is to expensive. The html is cached for 21 days and maybe result in this difference

https://www.mediawiki.org/wiki/Manual:Purge

But for some time depending variables, like used here to show the countdown, the expiry time is smaller

After purge, the legacy parser shows
https://sv.wikipedia.org/wiki/Olympiska_vinterspelen_2026?useparsoid=0

<!--
NewPP limit report
Parsed by mw‐web.eqiad.next‐6b5bf79959‐6lll5
Cached time: 20251031144252
Cache expiry: 29836
Reduced expiry: true
Complications: [show‐toc]

So this html is invalid at midnight in your timezone and reparsed, looks good to me.

Visiting the same page with parsoid shows, that the ttl is not set as on the legacy parser.

https://sv.wikipedia.org/wiki/Olympiska_vinterspelen_2026?useparsoid=1

<!--
NewPP limit report
Parsed by mw‐api‐ext.eqiad.next‐7f88659854‐t567p
Cached time: 20251031144532
Cache expiry: 2592000
Reduced expiry: false
Complications: [show‐toc, use‐parsoid]

VisualEditor is using parsoid, so some edit preview may show the old countdown, only the legacy parser is correct here.

Hint for parsoid developer: CoreMagicVariables::CACHE_TTL_BY_ID and ::DEADLINE_DATE_SPEC_BY_UNIT and everything around that consts like ParserOutput::updateCacheExpiry

Umherirrender renamed this task from The functionality for "days left until" is not working correctly on Wikipedia to The functionality for "days left until" is not working correctly with parsoid.Oct 31 2025, 3:03 PM
ssastry triaged this task as High priority.Nov 4 2025, 3:12 PM
ssastry subscribed.

guwiki also reported this on mw:Parsoid:Feedback.

Change #1202219 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Export Language::computeUnitTimestampDeadline()

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

Change #1201838 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/ParserFunctions@master] Replace use of (ineffective) Frame::setTTL()

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

Change #1201829 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/Scribunto@master] Remove use of Frame::setTTL/getTTL

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

Change #1202219 merged by jenkins-bot:

[mediawiki/core@master] Export Language::computeUnitTimestampDeadline()

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

Change #1201838 merged by jenkins-bot:

[mediawiki/extensions/ParserFunctions@master] Replace use of (ineffective) Frame::setTTL()

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

Change #1201829 merged by jenkins-bot:

[mediawiki/extensions/Scribunto@master] Remove use of Frame::setTTL/getTTL

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

Change #1211138 had a related patch set uploaded (by OSleger; author: OSleger):

[mediawiki/core@master] Fix cache expiration time for parsoid usage

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

Change #1211138 merged by jenkins-bot:

[mediawiki/core@master] Fix cache expiration time for parsoid usage

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

Change #1211240 had a related patch set uploaded (by C. Scott Ananian; author: OSleger):

[mediawiki/core@wmf/1.46.0-wmf.4] Fix cache expiration time for parsoid usage

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

Change #1211240 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.4] Fix cache expiration time for parsoid usage

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

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:17:45Z] <urbanecm@deploy2002> Started scap sync-world: Backport for [[gerrit:1211146|Do not add IPInfo buttons when there is no mw-data-target (T410988)]], [[gerrit:1211174|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211175|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211240|Fix cache expiration time for parsoid usage (T408741)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:19:53Z] <urbanecm@deploy2002> kharlan, tchanders, cscott, urbanecm: Backport for [[gerrit:1211146|Do not add IPInfo buttons when there is no mw-data-target (T410988)]], [[gerrit:1211174|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211175|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211240|Fix cache expiration time for parsoid usage (T408741)]] sy

Change #1211244 had a related patch set uploaded (by Urbanecm; author: OSleger):

[mediawiki/core@wmf/1.46.0-wmf.3] Fix cache expiration time for parsoid usage

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

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:33:02Z] <urbanecm@deploy2002> Finished scap sync-world: Backport for [[gerrit:1211146|Do not add IPInfo buttons when there is no mw-data-target (T410988)]], [[gerrit:1211174|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211175|hCaptcha: Include AlwaysChallengeSiteKey in list of valid keys (T410863)]], [[gerrit:1211240|Fix cache expiration time for parsoid usage (T408741)]] (duration: 15m

Change #1211244 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.3] Fix cache expiration time for parsoid usage

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

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:46:01Z] <urbanecm@deploy2002> Started scap sync-world: Backport for [[gerrit:1211244|Fix cache expiration time for parsoid usage (T408741)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:48:08Z] <urbanecm@deploy2002> urbanecm: Backport for [[gerrit:1211244|Fix cache expiration time for parsoid usage (T408741)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Test cases were https://test.wikipedia.org/wiki/User:Cscott/T408741 for group 0 and https://en.wikipedia.org/wiki/User:Cscott/T408741 for group 1/2 -- both of which had the maximum expiry time before the deploy, and then after deploy and action=purge fell down to the expected expiry times. For example:

<!-- 
NewPP limit report
Parsed by mw‐debug.codfw.pinkunicorn‐5bb9764dc8‐9h96c
Cached time: 20251125215220
Cache expiry: 1806
Reduced expiry: true
Complications: [use‐parsoid]
CPU time usage: 0.179 seconds
Real time usage: 0.185 seconds
Preprocessor visited node count: 12/1000000
Revision size: 253/2097152 bytes
Post‐expand include size: 84/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 3/100
Expensive parser function count: 0/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 0/5000000 bytes
Number of Wikibase entities loaded: 0/500
-->

expiry time now 1806 seconds, which is the 15-minute minimum plus the expected random stagger.

Mentioned in SAL (#wikimedia-operations) [2025-11-25T21:58:59Z] <urbanecm@deploy2002> Finished scap sync-world: Backport for [[gerrit:1211244|Fix cache expiration time for parsoid usage (T408741)]] (duration: 12m 58s)

Change #1219157 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] ParserOutput: avoid use of ::merge*MetaDataFrom()

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

Change #1225559 had a related patch set uploaded (by OSleger; author: OSleger):

[mediawiki/core@master] Parsoid integration: Test for merging cache expirations

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

Change #1225559 merged by jenkins-bot:

[mediawiki/core@master] Parsoid integration: Test for merging cache expirations

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