Jump to content

User talk:Mxn/CommentsInLocalTime.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Interface-protected edit request on 18 November 2022

[edit]

This script has a bug causing the browser window to hang unresponsively when encountering certain invalid dates. I will not include triggering examples in this edit request for obvious reasons, but User_talk:Thparkth/CommentsInLocalTime.js contains two examples (the zeroth of August and the 32nd of August). I found the issue trying to read Wikipedia:Dispute_resolution_noticeboard/Volunteering which contains the "zeroth of August" string.

My proposed edit modifies the date-matching regexp so that this particular bug will not be triggered. It also adds a "break glass" escape counter from the main while() loop to handle any other parsing misadventures that we don't currently know about. If there are other issues like this out there, the page will hang for around a second instead of forever.

The edit request is this diff: [1] Thparkth (talk) 22:00, 18 November 2022 (UTC)[reply]

Note the "break glass" fix triggers on WP:GAN, reported by @Olivaw-Daneel here. I can't look into the actual underlying parsing error immediately but this edit request would be a good band-aid. Thparkth (talk) 22:06, 18 November 2022 (UTC)[reply]
  •  Not done as to the immediate edit request. On the gadgets page, users are warned that this script is managed by a single user, Mxn - who is not inactive. As such, Mxn can make any changes to their own script as they see fit. — xaosflux Talk 23:03, 18 November 2022 (UTC)[reply]
Understood, I mistakenly thought that Mxn would be the person seeing the request :) Thparkth (talk) 23:07, 18 November 2022 (UTC)[reply]
@Thparkth: Thank you for narrowing down the issue! The root cause had eluded me for years until I saw the examples you provided. I applied a different fix that should hopefully address the problem even more rigorously. If you'd like to reach me in the future about something urgent, please post something on my main user talk page or e-mail me, as I'm unable to monitor my watchlist regularly. Thanks again! Minh Nguyễn 💬 18:05, 24 December 2022 (UTC)[reply]