Page MenuHomePhabricator

Special:NewPagesFeed times incorrectly show as 1 hour ahead
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Visit [[Special:NewPagesFeed]]
  • Filter by mainspace
  • Sort by newest on top

What happens?:

  • Article creation dates and times have a time 1 hour ahead of the current time

2022-03-06_014655.png (455×1 px, 71 KB)

2022-03-06_014705.png (732×1 px, 111 KB)

2022-03-06_014737.png (470×1 px, 26 KB)

What should have happened instead?:

  • Articles should display the correct creation date

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

  • Windows 10
  • Chrome 98.0.4758.102 62-bit
  • enwiki MediaWiki 1.38.0-wmf.24 (f9858b2)

Other notes

  • Perhaps daylight savings time related? DST is coming up. It is spring forward in a week.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Novem_Linguae What timezone have you set in Special:Preferences?

kostajh subscribed.

Thanks for filing this. Moving to Triaged on the Growth-Team board as it's not something we're able to prioritize in the short-to-medium term.

Can still reproduce as of 11/09/22. Likely some kind of daylight savings time error.

After debugging, this appears to be caused by modules/ext.pageTriage.util/models/ext.pageTriage.article.js, line 28, offset = parseInt( mw.user.options.get( 'timecorrection' ).split( '|' )[ 1 ] ); Specifically, mw.user.options.get( 'timecorrection' ) is returning the wrong time correction for me.

More details at T323193. Basically this appears to be an upstream error and we'll need to wait on that ticket for the fix.

After debugging, this appears to be caused by modules/ext.pageTriage.util/models/ext.pageTriage.article.js, line 28, offset = parseInt( mw.user.options.get( 'timecorrection' ).split( '|' )[ 1 ] ); Specifically, mw.user.options.get( 'timecorrection' ) is returning the wrong time correction for me.

More details at T323193. Basically this appears to be an upstream error and we'll need to wait on that ticket for the fix.

I wrote a comment in T323193#8399658, I don't see anything obviously wrong in the code, and I don't think a recently merged patch might have caused that. Most importantly, I think the logic in PageTriage is wrong/fragile. Instead of using the offset, it should check if the timezone is geographical, and use that to compute the correct offset.

Most importantly, I think the logic in PageTriage is wrong/fragile. Instead of using the offset, it should check if the timezone is geographical, and use that to compute the correct offset.

That can't be done in JavaScript except by using bulky libraries like moment-timezone. PageTriage uses the DST-corrected timezone offset which the backend is supposed to export in mw.user.options.get( 'timecorrection' ).

Most importantly, I think the logic in PageTriage is wrong/fragile. Instead of using the offset, it should check if the timezone is geographical, and use that to compute the correct offset.

That can't be done in JavaScript except by using bulky libraries like moment-timezone. PageTriage uses the DST-corrected timezone offset which the backend is supposed to export in mw.user.options.get( 'timecorrection' ).

Good point, I didn't realize that JavaScript has nonexistent support for IANA timezones... I think exposing the offset from the server-side is not the best solution though. Lack of timezone parsing in JavaScript seems a more fundamental issue that would benefit from a different solution, one that could be reused elsewhere. Maybe something like a library, although possibly smaller than momentjs (which is also no longer maintained I think).

Change 860646 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/GlobalPreferences@master] GlobalPrefs should apply same options corrections as core

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

Timezone bug in PageTriage Special:NewPagesFeed is back for me. All times are one hour behind the actual time. Probably because USA recently switched to daylight savings time (spring forward), and an offset being stored somewhere was not updated.

TheresNoTime changed the task status from Open to Stalled.Jul 12 2023, 2:16 PM
TheresNoTime added a project: Patch-For-Review.
TheresNoTime subscribed.

Stalling on Patch-For-Review

Aklapper changed the task status from Stalled to Open.Jul 12 2023, 6:50 PM

(Resetting status, as I'm worried that otherwise every task with an open patch would be "stalled" :)