Commit graph

16 commits

Author SHA1 Message Date
Bartosz Dziewoński c1442f8331 Replace deprecated database stuff
From in-person code review with Amir:
* getConnectionRef() has been deprecated in favor of getConnection()
* 'watchlist' query group no longer exists (T263127)
* Since this simplifies things, we can remove our wrapper methods

Change-Id: Ic610233b2e6d6ed68f7e1f5b31bb8996ed77f04b
2022-08-16 18:51:28 +00:00
Bartosz Dziewoński 4c17819a76 Migrate usage of Database::select (and friends) to SelectQueryBuilder
Bug: T312466
Change-Id: I99d4402d796421221a1c6c56ef88b023cb495833
2022-08-13 00:32:45 +02:00
Ed Sanders af54bae2ec Prefer late static binding over self::
While in many cases the class will never be sub-classed, it's easier
just to always use static:: and not worry about predicting which
classes might have problems in the future.

Change-Id: I23072a1701b5acf62bb3379a877de97627d8fcf3
2022-06-09 15:12:48 +01:00
Bartosz Dziewoński a31f022ba5 Remove limit on the number of topic subscriptions per user
We added the limit out of abundance of caution, because we were not
sure how the table is going to grow. We can see now that it's growing
slowly and reasonably.

Bug: T294881
Change-Id: I5da444c5d070926452e96ddbbe728b9e0375e466
2022-04-14 17:52:23 +00:00
jenkins-bot c4fb0f7046 Merge "Change auto topic subs to re-subscribe you if you unsubscribed" 2021-12-17 15:32:40 +00:00
Ed Sanders 4a88be8084 Move user subscription limit to config
This makes it easier to change going forward, and
configurable on 3rd party wikis.

Bug: T294881
Change-Id: I9e5343cab42cb00ed6b62cf5adf9e02b072481f1
2021-12-16 21:07:40 +01:00
Bartosz Dziewoński d3a7476cef Change auto topic subs to re-subscribe you if you unsubscribed
Bug: T295950
Change-Id: I7d3136c8bd7042b03487d85decea30a56dc3cde6
2021-11-29 21:37:11 +01:00
Bartosz Dziewoński 0d57aa9762 Automatic topic subscriptions (on any edit)
Bug: T284836
Change-Id: Ia42ad087218fd91a0cdd1664157d1049738e3c01
2021-11-15 22:45:42 +01:00
Bartosz Dziewoński 9273611a08 Remove unused 'use' definitions
I guess that at some point this class was meant to convert some
timestamps, but it does not (it returns them as strings in the
database format).

Change-Id: I33ee5e8807ee686b77819ef16f43509326c60762
2021-08-31 22:03:51 +02:00
Bartosz Dziewoński bcd92a5d33 Minor cleanups in topic subscription code
For automatic topic subscriptions, I plan to introduce a third
subscription state to indicate them. This patch includes minor tweaks
I wanted to add while working on that:

* Introduce constants instead of numbers
* Remove a TODO that doesn't seem like a good idea any more
* Remove a `"length": 1` on sub_state that did not do anything
  (but it might have been meant to indicate that it was supposed
  to be a boolean, which would be wrong)

Bug: T284836
Change-Id: I6e6096968ad38510102287bccd349090b6ca4280
2021-08-17 22:22:15 +02:00
libraryupgrader b0884b177c build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* glob-parent: 5.1.1 → 5.1.2
  * https://npmjs.com/advisories/1751 (CVE-2020-28469)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: I7a71e23da561599da417db3b3077b78d91173bbc
2021-07-22 16:29:04 +00:00
Bartosz Dziewoński 6a50d1203c Limit number of topic subscriptions per user
Per Manuel Arostegui in T263817#7033384. The limit is 5000.
(I picked it arbitrarily, there's no real rationale for it.)

Also log a warning when any user reaches half of the limit,
so that we might make a decision about changing this mechanism
before it starts affecting users. Maybe at that time we'll
have data to show that it's safe to remove the limit.

Bug: T263817
Change-Id: I18a8ee0ad7383759229c5721d5253fb591457d4d
2021-05-25 17:16:24 +02:00
Umherirrender 33f94693fb Replace uses of DB_MASTER with DB_PRIMARY
This requires MediaWiki version 1.36

Change-Id: Idc9edb06b2a080ea9d64e6cdac0b68eb14c485f9
2021-05-13 02:11:45 +02:00
Ed Sanders 11d40d2663 SubscriptionStore: Allow empty array to be passed to fetchSubscriptions
Change-Id: Ib2b659645ed55bc7a64f9971f0e054907c86a552
2021-05-05 19:16:54 +01:00
Bartosz Dziewoński 475aa80057 Fetch user's topic subscriptions on the page in a single query
Previously, we have made a query per each topic on the page.

Bug: T281000
Change-Id: I1029e62a65fc191ca37e1178ea7ffc55afafa1b9
2021-04-28 21:54:26 +00:00
David Lynch 86be6f83da Service to interact with topic subscriptions
Bug: T264885
Change-Id: Ie9592de655f50e1d0cf02a7f795b5203398a9696
2021-04-06 21:25:13 +00:00