Commit graph

1652 commits

Author SHA1 Message Date
Bartosz Dziewoński 4be0751517 Fix almost all errors codes being logged as http-0
Follow-up to b52699ad35.

Bug: T290514
Change-Id: If82f10c58872d990b9dfa7cbdc9b784454a5fa46
2021-09-28 13:14:29 +02:00
Translation updater bot 57f6b6ddd3 Localisation updates from https://translatewiki.net.
Change-Id: Ibaabb077e6a7bbeefbd078797d19353311de7df1
2021-09-28 08:18:41 +02:00
Bartosz Dziewoński c1f4668806 Change CommentParser and ImmutableRange to use offsets in codepoints instead of bytes
The PHP DOM extension measures lengths and offsets in Unicode codepoints.
Our PHP code used UTF-8 bytes, causing some offsets to be slightly off.
Now it mostly uses Unicode codepoints as well (we're forced to use bytes
in a few places, because preg_match returns offsets in bytes).

In practice, this had no visible effect to the user. It caused the
markers `<span data-mw-comment-end="..."></span>` to be placed at
the end of their container instead of the correct position when the
timestamp contained multibyte characters (e.g. "ź" in Polish); but
the correct position is usually at the end of the container anyway.

In the test cases, the only difference is placing these markers before
a trailing line break inside `<p>...</p>` tags rather than before it.

The patch also accidentally fixes another bug, where element nodes
with no children (mostly <img>) were incorrectly excluded when calling
cloneContents(), because they were treated as if they were text nodes.

Change-Id: Iccdccf1078598f4b62cab96225e9c85a4c0e93ee
2021-09-27 19:04:16 +00:00
jenkins-bot 408bbc62a3 Merge "Change the "Watch this page" label to distinguish it from topic subscriptions" 2021-09-27 17:26:14 +00:00
jenkins-bot 118b958f8b Merge "Use MediaWiki's new section edit summary if the user didn't modify it" 2021-09-27 17:11:32 +00:00
Translation updater bot f6c5a0f804 Localisation updates from https://translatewiki.net.
Change-Id: If332718d4ded6e55b5bbb9a01caedc1d3547727c
2021-09-27 08:34:44 +02:00
Alexander Vorwerk b73f4b1a70 Replace usage of deprecated PageProps::getInstance()
Bug: T289544
Change-Id: Ib4d86c298508b3dc56c44a4fa7314218f8a0d930
2021-09-26 00:48:51 +00:00
Translation updater bot e6c9d3f328 Localisation updates from https://translatewiki.net.
Change-Id: Ic0da565b5509ea688d16e24dfe446dc7c6e47a93
2021-09-24 08:26:09 +02:00
jenkins-bot abd6c2fedd Merge "Enhance Echo user talk edit and mention notifications" 2021-09-24 02:17:57 +00:00
Translation updater bot 1105554785 Localisation updates from https://translatewiki.net.
Change-Id: I4f2383fb709a1c965a2e315a53161fd47f1c94fa
2021-09-23 12:27:33 +02:00
Translation updater bot ac8ff605d9 Localisation updates from https://translatewiki.net.
Change-Id: Ib3ef82dcf166e03f306957c1e145817f93da1c04
2021-09-22 08:10:37 +02:00
jenkins-bot 15747aba3a Merge "CommentParser: Remove outdated legacy ID algorithm" 2021-09-21 16:50:37 +00:00
jenkins-bot d25975209f Merge "Deduplicate logic for subscribable headings" 2021-09-21 16:50:29 +00:00
jenkins-bot 02a214d928 Merge "Put all checks for enabling the empty state for talk pages in one place" 2021-09-21 15:43:11 +00:00
Bartosz Dziewoński 0bf4a6ca90 Use MediaWiki's new section edit summary if the user didn't modify it
Bug: T275178
Change-Id: I5966cb5a523343f02ca955c27aa45822c29aab3f
2021-09-21 16:27:35 +02:00
Bartosz Dziewoński b6c8de03ef Change the "Watch this page" label to distinguish it from topic subscriptions
Bug: T290712
Change-Id: I02b89466a4e980e3cb2859b1ba5a3cbf4b5ae0ed
2021-09-21 11:44:06 +02:00
Bartosz Dziewoński 4a824abd0d Apply page transformations only when viewing pages
Follow-up to e634701460. We didn't need
this previously, because we relied on the ArticleParserOptions hook
only being called when viewing pages.

Context from code reviews a year ago:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/641837/comment/15ee0218_e4ab602f/
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/641837/comment/b62d4327_5ebc2e02/

Bug: T291459
Bug: T291460
Change-Id: I64f0be170719d874f5460934462917f4f13af6c1
2021-09-21 10:19:42 +02:00
Translation updater bot 8f929ccc26 Localisation updates from https://translatewiki.net.
Change-Id: I0013781874f0c7253b48e5249e7fb573d3368ad3
2021-09-21 08:08:55 +02:00
jenkins-bot c50b1630d1 Merge "Add API to get the status of topic subscriptions on a page" 2021-09-21 04:43:03 +00:00
Bartosz Dziewoński ca17555a67 Put all checks for enabling the empty state for talk pages in one place
They were spread across several places, and some of them were checking
different things, causing us to show the view mode on some
action=edit&redlink=1 links but without showing our empty state.

Bug: T291085
Change-Id: Id1864e58c47dbd22abb41d48e31f81318d9f94f9
2021-09-20 23:15:00 +02:00
jenkins-bot 152a663fb6 Merge "Always apply DiscussionTools page transformations" 2021-09-20 17:30:43 +00:00
Bartosz Dziewoński 435b0c65c7 Enhance Echo user talk edit and mention notifications
If the user talk edit or mention coincides with exactly one new comment:
* Change the primary link to be a direct link to the comment
* Add a text snippet to notifications that don't already include one
  (user talk edits that are not new sections).

This is done for all such notifications, regardless of whether anyone
has topic subscriptions enabled.

Bug: T281590
Bug: T253082
Change-Id: I98fbca8e57845cd7c82ad533c393db953e4e5643
2021-09-20 15:05:42 +02:00
Translation updater bot 70dd1e97ea Localisation updates from https://translatewiki.net.
Change-Id: I6590484d7d3824055646f389672140f40ffa4828
2021-09-20 08:18:49 +02:00
Bartosz Dziewoński 3dbc5749ea Adjust use of 'plainlinks' class to fix button styling in some cases
It was previously applied on the whole wrapper of the anon
warning, including the buttons. In some cases (on mobile, and
on some sites with weird customized site CSS), this causes the
buttons to lose some styling. Apply it only on the label.
Follow-up to 522b7932d7.

Bug: T270536
Bug: T291000
Change-Id: Ia4bc99fc219a80efbf46a7cc196ea29720a34de8
2021-09-18 03:16:43 +00:00
Translation updater bot 4c39068eb3 Localisation updates from https://translatewiki.net.
Change-Id: Ibd743268bc7dbeed1ae7d60f7e8311a99c198269
2021-09-17 08:45:16 +02:00
jenkins-bot 8de4776c20 Merge "Enable email delivery for our notifications for new users by default" 2021-09-16 18:59:32 +00:00
Translation updater bot be62b09ad7 Localisation updates from https://translatewiki.net.
Change-Id: I82647334b14d6ec651223ad7338ff8dd932c1a9b
2021-09-16 08:11:33 +02:00
David Lynch 46b6d76433 Enable email delivery for our notifications for new users by default
We're using the same approach as Echo is for its new-users-only settings

Bug: T287547
Change-Id: I1d8fff364da919caaf86af94cf5f0c6e40b67ff9
2021-09-15 23:54:30 -05:00
Translation updater bot 2265dd3732 Localisation updates from https://translatewiki.net.
Change-Id: I5a8ac3dd105a4f45364fe6c40111e7628356d9fe
2021-09-15 08:14:07 +02:00
Alexander Vorwerk 97a702cbc7 CommentParser: use IPUtils instead of the deprecated IP class
Bug: T291008
Change-Id: I0207940a642a32f2ca997b78387c9ff0af101599
2021-09-14 22:19:05 +02:00
Translation updater bot 7485d2d18f Localisation updates from https://translatewiki.net.
Change-Id: Iccbcc7cf9fac35932a6c4cb1384b5a97724d361e
2021-09-14 08:32:40 +02:00
Bartosz Dziewoński 9c20efcd4d Record timing for 'saveSuccess' and 'saveFailure' events
Bug: T290931
Change-Id: Id4ead2e0cc72174eec5f3849d8182d660905daea
2021-09-13 23:47:30 +00:00
jenkins-bot 269111d7aa Merge "Log more precise error codes for timeout etc. (and HTTP statuses)" 2021-09-13 16:17:35 +00:00
jenkins-bot 8581e4d3d7 Merge "Add some tests covering ThreadItem::getHTML() and related methods" 2021-09-13 16:12:55 +00:00
Translation updater bot 2d4b53a452 Localisation updates from https://translatewiki.net.
Change-Id: I0b46e987280a455de582ad0f53a0e7bb3eb6b1fc
2021-09-13 08:29:24 +02:00
Translation updater bot efbd93adef Localisation updates from https://translatewiki.net.
Change-Id: Ide8bb8480b493bd55651bd393fca003ef1e1032a
2021-09-10 08:15:27 +02:00
jenkins-bot 95c124d821 Merge "Remove client-side timeout when saving pages (again)" 2021-09-09 23:28:18 +00:00
Bartosz Dziewoński b52699ad35 Log more precise error codes for timeout etc. (and HTTP statuses)
Inspired by the code in mw.Api#getErrorMessage handling these cases.

Bug: T290514
Change-Id: I2eea17198dafaf9d3c4754cfb630de0ed7162daf
2021-09-09 23:46:44 +02:00
Bartosz Dziewoński 085ea2e8d1 Remove client-side timeout when saving pages (again)
Previously: e3e36e11ac (April 2020),
regressed: 3b31aa669d (October 2020).

Bug: T290514
Change-Id: Ifb09d62145e0b62c5b59708552a3a63b920e5b2f
2021-09-09 23:46:44 +02:00
Translation updater bot f2de0a465d Localisation updates from https://translatewiki.net.
Change-Id: I61adce5f1023fe9d79b61cf59bba8b18e4a6d422
2021-09-09 08:17:27 +02:00
libraryupgrader 26b69d2c70 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I76996ed939d706739d2094077c64eeca6f51126a
2021-09-08 23:14:53 +00:00
Translation updater bot 93079c7eab Localisation updates from https://translatewiki.net.
Change-Id: I74077147422a8549d4d5624c9582db1d6f5ea371
2021-09-08 08:10:15 +02:00
Bartosz Dziewoński e634701460 Always apply DiscussionTools page transformations
Bug: T273072
Bug: T280599
Change-Id: I0b39ef2f9ede15905951a54c043dd228bd5ace9f
2021-09-08 00:16:30 +02:00
Bartosz Dziewoński 0ae97ef550 Deduplicate logic for subscribable headings
Change-Id: I1cd96cf0bcce2101455702f1350d8a4336c60790
2021-09-07 21:38:35 +00:00
Bartosz Dziewoński 8bb36bd782 Add API to get the status of topic subscriptions on a page
(Split off from Ic0fabda0de4ebbc5e424f49641e6b03ebb4b7e6a)

Bug: T290185
Change-Id: Iacc0f92bedfcb49e8a05d98af4d8170d08b1c8de
2021-09-07 21:38:09 +00:00
Bartosz Dziewoński ce899aaadd Inject services in hook handlers where possible
Change-Id: Ie5c36cabd90412d2299b00d2b0c3c3bdf9ffc6d6
2021-09-07 22:51:35 +02:00
Bartosz Dziewoński c70a203111 Inject ConfigFactory in API modules
…plus minor tweaks.

Change-Id: I80ded8bac836f4a49d61c51c4d17b48687628986
2021-09-07 18:36:12 +02:00
Bartosz Dziewoński 9819df3288 CommentParser: Remove outdated legacy ID algorithm
Last changed in March (4a0802065c),
was only needed for about 2 weeks for compatibility with cached data.

Change-Id: I510238cb86a7b4d7ae5e8636716d1e9ca2d0e402
2021-09-07 17:41:30 +02:00
Translation updater bot e953a9c262 Localisation updates from https://translatewiki.net.
Change-Id: I97056dfc7e67b240232551e43083fa00fff8eb76
2021-09-06 08:20:39 +02:00
libraryupgrader d41ea5ed3c build: Updating stylelint-config-wikimedia to 0.11.1
Change-Id: I5e956c73e99afdaf467e067566dbdc3ca2efc30c
2021-09-04 19:36:49 +00:00