Page MenuHomePhabricator

Local time compatibility
Open, HighPublic

Description

After T275303 was resolved, I ask to to make the timestamps, for each edit and in the top of the list, to respect the "Time zone" settings in the "Time offset" area of Special:Preferences#mw-prefsection-rendering. Thanks.

Event Timeline

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

I'm also asking for this, it's quite annoying that the time zones aren't working on this page. Thanks in advance.

Change #1220863 had a related patch set uploaded (by Gerrit Patch Uploader; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Add local time compatibility to Global Watchlist.

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

IKhitron raised the priority of this task from Low to Medium.Wed, Dec 24, 5:42 PM
IKhitron moved this task from Coding to Gerrit WIP on the User-IKhitron board.

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://6c16706061.catalyst.wmcloud.org/w/

Change #1221985 had a related patch set uploaded (by Gerrit Patch Uploader; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Add local time compatibility to Global Watchlist.

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

@Tacsipacsi, I'll be glad if you can give me some advice. I'm asking you specifically, because of your recent work on the code of this extension on other task. This one is almost ready, I just need to debug cache (which keeps data on live updates or clicking on the extension refresh button) clearing on user preferences check. And to brush the code, remove the debugging output and write the documentation, of course. But I do not sure if I need also to create a cache on device to get the already converted timestamps when browser tab is refreshed or the special page closed and reopened after some time. Is the calculations saving on the first refresh worth adding three huge functions to take care of indexedDB? Thank you in advance.

IKhitron raised the priority of this task from Medium to High.Wed, Dec 31, 7:18 AM
  • Why are there two patches (I814955fc67940bd0542b4a358fdf5a94a387a27f and Iac065812081e05c462a5f50e309df9b05223970b)? Please indicate which one you want to get merged; the other one should be abandoned. (There should be an Abandon button in the upper right corner, but maybe it isn’t there for you because of the usage of Gerrit patch uploader – I see the button on my patch, but not on yours. If you don’t see the button, we should ask someone with sufficient privileges to abandon it; for the time being, you can prefix the commit message title with [ABANDONED], [DNM] or something similar.)
  • I didn’t read through the changes, but what I instantly noticed is that adding an API endpoint seems an overkill. There is a client-side date formatting module, which does what you want – and does it synchronously, so there is no need to cache anything. (IndexedDB would anyway be an overkill, and, depending on the implementation, could easily fill up the user’s storage.)
  • Why are there two patches (I814955fc67940bd0542b4a358fdf5a94a387a27f and Iac065812081e05c462a5f50e309df9b05223970b)? Please indicate which one you want to get merged; the other one should be abandoned. (There should be an Abandon button in the upper right corner, but maybe it isn’t there for you because of the usage of Gerrit patch uploader – I see the button on my patch, but not on yours. If you don’t see the button, we should ask someone with sufficient privileges to abandon it; for the time being, you can prefix the commit message title with [ABANDONED], [DNM] or something similar.)

Because last night Gerrit told me I can't continue with the patch and should copy to a new one. I haven't this button, so I'm planning to ask at IRC to mark it as abandoned, in a day or two, when there will be more people online. I asked there to mark the first patch as WIP a week ago, and nobody did it yet, I think because of Christmas, the previous ones were marked almost immediately. And I can't change the commit message, because Gerrit doesn't allow me to do this either.

  • I didn’t read through the changes, but what I instantly noticed is that adding an API endpoint seems an overkill. There is a client-side date formatting module, which does what you want – and does it synchronously, so there is no need to cache anything. (IndexedDB would anyway be an overkill, and, depending on the implementation, could easily fill up the user’s storage.)

Because I didn't know it exists, and I tryed to find for some time. Thanks a lot. I'll remove the cache, but before that, it wouldn't, because I care to remove every data that marked as seen from the cache, so it's on the same O() all the time.

Well, @Tacsipacsi, I tried, and it works, thanks again for bringing it to my attention. I need to clean it up, (for example remove second formatter, nevermind), and so on. But one question, please. The Special:Watchlist changes immediately if the user changed the preferred time zone in preferences somewhere else. The Special:GlobalWatchlist doesn't right now, only on browser refresh, because mw.user.options.get( 'timecorrection' ) is cached. What should I do? Forget about it? Use pretty expensive

new mw.Api().get( {
	action: 'query',
	meta: 'userinfo',
	uiprop: 'options'
} ).then( data => {
	timezone = data.query.userinfo.options.timecorrection;
} );

on every watchlist refresh? Something else? Thank you.

Because last night Gerrit told me I can't continue with the patch and should copy to a new one. I haven't this button, so I'm planning to ask at IRC to mark it as abandoned […]. And I can't change the commit message, because Gerrit doesn't allow me to do this either.

Strange. Maybe there’s a limit of ~256 on the number of patchsets? To be honest, I don’t think I’ve ever seen a Gerrit change with that many patchsets.

Because I didn't know it exists, and I tryed to find for some time. Thanks a lot.

You’re welcome. As I’ve wrote on some other task or Gerrit change recently, Google (and other generic search engines) are not very good at finding answers for MediaWiki-related development questions. (I rarely use AI for programming, but I know that AI is particularly bad at noticing changes in frameworks, and often does things like suggesting PHP 5 solutions in 2025. This module was introduced nine months ago in T389161.) I think I just went to https://doc.wikimedia.org/mediawiki-core/master/js/ (I have its URL in my browsing history; alternatively I could go to https://doc.wikimedia.org/ and select MediaWikiCode documentation (JS)), and typed date in the search box – the first result is what you need.

before that, it wouldn't, because I care to remove every data that marked as seen from the cache, so it's on the same O() all the time.

Sorry, I don’t understand this sentence. Could you please clarify it?

But one question, please. The Special:Watchlist changes immediately if the user changed the preferred time zone in preferences somewhere else. The Special:GlobalWatchlist doesn't right now, only on browser refresh, because mw.user.options.get( 'timecorrection' ) is cached. What should I do? Forget about it? Use pretty expensive

new mw.Api().get( {
	action: 'query',
	meta: 'userinfo',
	uiprop: 'options'
} ).then( data => {
	timezone = data.query.userinfo.options.timecorrection;
} );

on every watchlist refresh? Something else? Thank you.

How often do you change your time zone preferences? I wouldn’t care. Other preference changes (language, skin etc.) don’t take effect immediately either.

Strange. Maybe there’s a limit of ~256 on the number of patchsets? To be honest, I don’t think I’ve ever seen a Gerrit change with that many patchsets.

A 1000 lines, including patch sets, comments, and test results. Me too, but people usualy just load the results to Gerrit, not work there.

the first result is what you need.

Thanks, I'll try it next time.

before that, it wouldn't, because I care to remove every data that marked as seen from the cache, so it's on the same O() all the time.

Sorry, I don’t understand this sentence. Could you please clarify it?

Apologies, my English is bad. I'll try once more. If you add new entries to the cache again and again, it constantly grows and will blow up eventually. In my case the cache was always of the same size "level", because it didn't include all the data from the past, only the needed for the current refresh, external by browser or internal by extension. All the rest was immediately removed. It wasn't fully implemented yet, I was waiting to decide if there should be cache between browser refreshings, but the full mechanism was supposed to be a second variable that keeps all that used in this iteration, from the cache and from the api, which overrided the cache at the end of the iteration. Hope it's better explanation.

How often do you change your time zone preferences? I wouldn’t care. Other preference changes (language, skin etc.) don’t take effect immediately either.

Great, thanks for the advice, I'll use it.

Apologies, my English is bad. I'll try once more. If you add new entries to the cache again and again, it constantly grows and will blow up eventually. In my case the cache was always of the same size "level", because it didn't include all the data from the past, only the needed for the current refresh, external by browser or internal by extension. All the rest was immediately removed. It wasn't fully implemented yet, I was waiting to decide if there should be cache between browser refreshings, but the full mechanism was supposed to be a second variable that keeps all that used in this iteration, from the cache and from the api, which overrided the cache at the end of the iteration. Hope it's better explanation.

Now I understand what you meant, thanks for the explanation!

I opened the change to review. Thank you, @Tacsipacsi, for your advice. I did not add you as a reviewer because you didn't answer yet on my question on your talk page.

Change #1220863 abandoned by Thcipriani:

[mediawiki/extensions/GlobalWatchlist@master] Add local time compatibility to Global Watchlist.

Reason:

Continues in Iac065812081e05c462a5f50e309df9b05223970b

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

@Tacsipacsi, I can see you're here every day. Maybe you missed all the pings. Could you please answer at least about the messagebox, so I could start working, instead of loosing time. Thank you.

Well, @Tacsipacsi and @matmarex, I wanted to make both variants of the code, to leave one which will be chosen. But it does not compile, and I have no idea what to do any more, and advice I get does not help. The problem is in the line

new mw.Api().saveOption( 'userjs-globalwatchlist-flags', 'teststring' )

which whatever I try with it, fails on test

mediawiki.base/track
✖ trackError
  Firefox 140.0 (Linux 0.0.0)
Expected: [
  "emit1",
  "sub",
  "foo",
  "emit2",
  "bar"
]
Actual: [
  "emit1",
  "sub",
  "{\"exception\":{},\"source\":\"resolve\"}",
  "foo",
  "emit2",
  "bar"
]
verifySteps@node_modules/qunit/qunit/qunit.js:1626:14

I have no idea what to do any more. If the decision will be to use php, I'll just remove this part. Until then, I'm stuck.

@Tacsipacsi, I can see you're here every day. Maybe you missed all the pings. Could you please answer at least about the messagebox, so I could start working, instead of loosing time. Thank you.

I’m here every day, but I have only limited time in one block during the week, so I focus on things that are more quickly done. When a change gets 15 patch sets a day (yes, in the eight days since my last comment, you uploaded 118 patch sets, that’s 14¾ per day on average), it takes some time to even understand what’s happening, let alone replying. So I don’t have time for you on workdays, sorry.

@Tacsipacsi, I can see you're here every day. Maybe you missed all the pings. Could you please answer at least about the messagebox, so I could start working, instead of loosing time. Thank you.

I’m here every day, but I have only limited time in one block during the week, so I focus on things that are more quickly done. When a change gets 15 patch sets a day (yes, in the eight days since my last comment, you uploaded 118 patch sets, that’s 14¾ per day on average), it takes some time to even understand what’s happening, let alone replying. So I don’t have time for you on workdays, sorry.

You absolutely do need to apologize. I'm glad you're still interested in it, I thought you decided it takes too much time or something, if you didn't answer as before, and didn't say something like "Busy now, see you in X time". Thanks a lot.

@IKhitron: I think that telling other contributors how they should spend their time is intimidating and inappropriate. People volunteer to help (e.g. reply, or review code), and if they decide to spend their time in other ways, then that's their personal freedom to do so, unless there was some contract or SLA in place or such.
Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct - thanks.

@IKhitron: I think that telling other contributors how they should spend their time is intimidating and inappropriate. People volunteer to help (e.g. reply, or review code), and if they decide to spend their time in other ways, then that's their personal freedom to do so, unless there was some contract or SLA in place or such.
Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct - thanks.

Thank you. It was definitely my mistake in bad wording. I didn't mean anything like this, but I can see why it looks like this. All I wanted is to be sure that they are still on board, after spending a lot of time of this, and suddenly stopping, so I thought it could be this or ping didn't work. Again, if I could hear something as "I'm aware, but have no time for a year", it would be enough. So I really didn't want something that looks like "Do it now". Just asked this question, and asked if it is possible to answer on one particular question, if there is no time for all them soon. My apologies that it looks like this.