Commit graph

26 commits

Author SHA1 Message Date
Umherirrender 3536de166e postgres: Convert timestamp in EchoUnreadWikis
The compare with DEFAULT_TS_DB does not work, because postgres using
different timestamp format on the database

Bug: T244898
Change-Id: I81fe88f78d94499ae9082a4fb6b1191bd432f977
2022-07-16 16:33:40 +00:00
Umherirrender c650698ac5 Call IDatabase::timestamp before inserting echo_unread_wikis
The default timestamp of 00000000000000 cannot represent as timestamp,
because it gets a negative timestamp -00011130000000

This is needed for proper cross-RDBMS support

This reapply a change from I46206e0b3a687dff3168a81cf0020e669133e876,
reverted with I1c8c409b7820512b3e31246a7f3d8c1cf4db209c.

Bug: T244898
Change-Id: I109b783de0a8d60ccb161b280ce5fa09e145017b
2022-04-11 23:12:02 +00:00
Hashar 9433b83f2d Revert "Call IDatabase::timestamp before inserting rows"
This reverts commit 4eb8fa23e4.

Reason for revert:

 Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp:
 The timestamp cannot be represented in the specified format

Bug: T304307
Change-Id: I1c8c409b7820512b3e31246a7f3d8c1cf4db209c
2022-03-21 13:28:37 +00:00
Umherirrender 4eb8fa23e4 Call IDatabase::timestamp before inserting rows
This is needed for proper cross-RDBMS support

Bug: T244898
Change-Id: I46206e0b3a687dff3168a81cf0020e669133e876
2022-02-11 23:22:17 +00:00
Petr Pchelko a10b0b07c8 Use CentralIdLookupFactory and pass UserIdentity
Change-Id: I44144df7cf244eb867c1b261c10cc29b020f8409
2021-07-21 19:23:42 -07:00
libraryupgrader b3f948c59c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I4b2fb7f46b6c0a5c33a6ad25f085de8ae13eb084
2021-05-04 09:05:15 -07:00
Reedy 2afb728a10 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I506e43629a30ef34c9154b8212878255de7d90b9
2020-09-19 21:26:38 +00:00
Aaron Schulz 0bc5117dbb Fix IDatabase::upsert() call with bad unique key parameters
Change-Id: I13c484991166eba7b90eef13c324834a39db63a9
2020-02-19 13:20:40 -08:00
Umherirrender f62ab66363 build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Bug: T235049
Change-Id: I93844dc6fae8a3dca3ced591d43caa2f994ba2f1
2019-11-18 20:03:13 +01:00
Thiemo Kreuz 229c3d0fdd Remove non helpful (auto-generated) comments
None of these comments explains anything that wouldn't be obvious
from the code itself.

Change-Id: Ibcf50d401999ae76f315df2d2d27097a39f41bbd
2019-10-23 12:31:35 +02:00
jenkins-bot d53af8b8d3 Merge "Use "false" as type hint in PHPDoc tags" 2018-08-16 01:00:05 +00:00
Thiemo Kreuz 8a7c3a78a9 Use "false" as type hint in PHPDoc tags
Most modern IDEs as well as documentation generators understand the
keywords "false" and "true", when a bool can only be one of the two.

Change-Id: I83dd1f0cc0802fa74ee35e7ca7425615230a767f
2018-08-13 15:31:13 +00:00
Thiemo Kreuz c1c3c7b672 Make "@… array" type hints more specific
There are about 200 of such generic "array" type hints in this code base,
the majority in @param tags. I started with what I found most relevant:
@var and @return tags. I might continue working on this later, but
wanted to stop for now to keep this patch moderately small.

Change-Id: Iff0d9590a794ae0f885466ef6bb336b0b42a6cd3
2018-08-13 09:27:37 +02:00
Roan Kattouw 544129492d UnreadWikis: Check the actual object we're about to call a method on
In principle, if $alertCount > 0, $alertTime should never be null,
but it feels much safer to check $alertTime itself instead.

Change-Id: Ifb107e257fbcd65e8181e2a214028f1b3733ac30
2018-05-30 05:03:51 +00:00
Aaron Schulz 06b6aee301 Add various read-only mode checks
* Make updateCount() check isReadOnly()
* Make EchoUserNotificationGateway::markRead() check isReadOnly()
* Make ApiEchoMarkRead check if the echo DB is read-only
* Remove access getExternalLB() argument

Bug: T187942
Change-Id: Ibafce8839b46e28251a6c1c08dd61fec4756bf33
2018-02-22 08:07:19 -08:00
Umherirrender 08cb7a470a Change doc type from DatabaseBase to IDatabase
Change-Id: I853b7cef85fdd77c28a947a8f3601f84ba17359a
2017-12-22 23:20:13 +01:00
libraryupgrader 7a23ddf4b0 build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Change-Id: I7b19fab3b1100c4973600ec95ee24160e141c5ac
2017-09-24 09:49:43 +00:00
James D. Forrester 8c810dff48 build: Update mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I25cb61b3b92798f1259d1575a336e2b056d5764f
2016-12-05 15:54:30 -08:00
Matthew Flaschen ed626af0ad backfillUnreadWikis: Skip updateCount if race condition detected
Related doc fixes

Change-Id: I1b7545d2f86ec87e9701811ac5f4db0fec690681
2016-07-18 20:58:48 -04:00
Matthias Mullie 6be71f2fae Delete rows in echo_unread_wikis if there are no unread notifs
It used to be like this, but in order to get the messages badge to show
in the correct circumstances, I had to know if the user had ever had
foreign messages before & I also needed euw_messages_ts even if those
messages had already been read.

Now that we're unconditionally showing messages, we no longer need these
0-value rows.

Bug: T127731
Change-Id: I1fc13bf0e5133ae39224f66d1b5a59c769bfcee2
2016-02-23 16:21:28 +01:00
Stephane Bisson 7dc87b9f7a Allow setting the unread counts to 0 in the echo_unread_wikis
Bug: T127331
Change-Id: I90342c9d64277faa77a905b227148d3102d049cb
2016-02-18 15:31:55 -05:00
Matthias Mullie b9f2d026a6 If user only has foreign messages, the messages badge should not be suppressed
Bug: T124372
Change-Id: Id9699c56e9b8c6af77e74cbfc48b6e4e3464b3a5
2016-02-10 13:25:50 +01:00
Roan Kattouw 63eef35026 Cross-wiki notifications integration
Bug: T121829
Change-Id: Ifb52ad5605a56d27e5951479326689242a49430e
2016-01-13 09:47:57 -08:00
Kunal Mehta 999c53a1c3 Use CentralIdLookup instead of hardcoding for CentralAuth
Change-Id: I5b2d23588ab6b026d1a2100b9c16a74e9aefbd73
2015-12-08 16:54:23 -08:00
Roan Kattouw 23734e3539 Follow-up b85f978ddd: don't check for the non-existent CentralAuth class
Change-Id: Ie7ca022c659f9856641aaec6183eadf8a86865a2
2015-11-24 19:34:27 -08:00
Kunal Mehta b85f978ddd Track what wikis a user has unread notifications on
This implements a backend layer and database storage for tracking what
wikis a user has unread notifications on. It is not yet exposed via any
API.

Whenever the notification counts on the local wiki are reset, a deferred
update is queued to also update the central database table.

Change-Id: Id1498bdeb5811d6848dc66781ffca03e726eab90
2015-11-20 15:54:11 -08:00