Commit graph

69 commits

Author SHA1 Message Date
jenkins-bot e39c521750 Merge "Fallback to master lookup for title when lookup in slave fails" 2014-08-27 22:52:35 +00:00
bsitu 65bb14b33e Specify which event type to use job queue
This will allow us to specify which notifications to use job queue

Change-Id: I7bf576acf332f5344b35188b5262df2319d15b79
2014-08-27 11:39:53 -07:00
bsitu cb971c4ca0 Fallback to master lookup for title when lookup in slave fails
Bug: 69913
Change-Id: I5d6a4ec750dc8438c92c9e70c36554ff7dbc97f1
2014-08-26 22:33:28 +00:00
bsitu f29f7303d1 Make timestamp in consistent format after loaded from database
Notification timestamp is generated in MW format (YYYYMMDDHHMMSS)
inside the model and saved to the database in db specific format,
We need to convert it back to MW format when loading the data
from the database, it just happens that MW format is the same
as MySQL timestamp format

Change-Id: Ie881b66c8c24d57a8933c0153e9e7db5fe6aa017
2014-08-22 15:53:51 -07:00
jenkins-bot 979b3e6425 Merge "Revert "Make timestamp in consistent format after loaded from database"" 2014-08-22 21:52:02 +00:00
Bsitu 271d192f69 Revert "Make timestamp in consistent format after loaded from database"
It should handle NULL

This reverts commit 31a986bebd.

Change-Id: I202a7c6f8deaf0b6bbf3af1981f4f25077e916db
2014-08-22 21:50:34 +00:00
jenkins-bot 620c063910 Merge "Make timestamp in consistent format after loaded from database" 2014-08-22 18:11:00 +00:00
bsitu 31a986bebd Make timestamp in consistent format after loaded from database
timestamp is generated in MW format (YYYYMMDDHHMMSS)
for notification but it's
loaded into model in the database specific format.  We just need
to convert it back to MW format, it just happens that MW
format is the same as MySQL timestamp format

Change-Id: I1f7f2aeb32b63d47e92631d6daa711d9c32e4017
2014-08-22 18:09:39 +00:00
bsitu 25d6d71a61 [5] Code cleanup and miscellneous fix
* cache function result in local variables

* Update the logic of generating notification date header

Change-Id: I04c3ed853076f17c819da8f27bfdb169e99b2a3a
2014-08-19 17:58:07 +00:00
bsitu 55fb42b681 [4] Add revision local cache holder object
Change-Id: I85f68b3ca269c711a8a177e013bd8eba38833444
2014-08-19 10:28:38 -07:00
bsitu 49350a5b52 [3] Use title local cache to cache title object
Change-Id: Ibfbe99be8ebf3ca8d7241e4ed991a183bd0e3f27
2014-08-18 14:09:15 -07:00
bsitu d6ff5a54c2 [1] Make title lazy loaded in EchoEvent
* We can batch load titles and load it when requested

Change-Id: I063ca44ddbd8cb3f61537d8b160a10cf390d7926
2014-08-15 20:19:08 -07:00
jenkins-bot 124cbbd036 Merge "Auto mark notification as read if it doesn't have target page" 2014-08-15 18:35:27 +00:00
bsitu 1cc0f83829 Move 'notification count refresh' logic out of mapper
Change-Id: I4c10b66e537dea5f9c5bc7ccba8f558cafd103d7
2014-08-15 16:02:23 +02:00
bsitu 61fea56641 Create TargetPage data if specified by EchoEvent
Change-Id: I71039eb03b4b7e617ce03d515a6d51c4f3666ab8
2014-08-15 00:16:41 +00:00
bsitu 7be9d68219 Auto mark notification as read if it doesn't have target page
The special page will now not auto mark a notification as read if
it has a target url. Currently no notifications have target urls
but this will be changed in a later patch...

Change-Id: I9bd71d59391189d5d761ab5f1c84af0bc3554be0
2014-08-15 00:11:57 +00:00
bsitu 029668423d Add TargetPage model and mapper to notifications
This will be used for marking a notificaiton as read when
a user visits a target page. The new table should keep the
volume as low as possible for fast data loopup. records
should be removed from the table once it's marked as read.

Change-Id: I605cbc79adfc12d22bd889c5bb513d05c479fe6e
2014-08-13 00:48:07 +00:00
bsitu 4bf88aa741 Hygiene: Add abstract model and mapper for notification
* Shared function can be put in the abstract class and this also enforces some interface methods 

* Initialize a default dbFactory when it's not passed to the mapper

Change-Id: I1033dafaa90a1f683fbe9ad69bed04f4844e357b
2014-08-13 00:11:15 +00:00
bsitu 427b7e2c38 Add support for splitting notifications into alert & message
Change-Id: I8eeeeb9a7a1539a258bc42584274897f9e7dc775
2014-08-05 14:50:54 -07:00
bsitu 267a56398e Introduce AttributeManager class
This is a precursor to splitting notifications into
alert and message sections.

Change-Id: Ic685f7026ab9b41407b51317780bbfadd05bf9f1
2014-07-31 11:41:00 -07:00
bsitu d3d99772b9 Replace EchoBackend with mappers and gateway
* Get rid of EchoBackend by separating responsibilities into smaller objects

* Move main fetchNotification logic from API to a more appropriate place

* Add more unit testing coverage

Change-Id: I42f4d7566543332588431c21c220c0d64d026b70
2014-07-31 10:29:52 -07:00
Kunal Mehta f551656aa2 Remove EchoEvent::updateExtra, MWEchoBackend::updateEventExtra
Unused functions.
There is also no usecase for this, events shouldn't be altered
after creation except for bundling.

Change-Id: Id175c075d24263119f0455d99342263dd98f9410
2014-07-13 22:53:57 +00:00
Thiemo Mättig e205992d0b Remove unused code and fix missing/broken documentation
General code cleanup as reported by the PHPStorm static code
analysis. I hope it's not a problem that I made a lot of very
different (but all very tiny) changes in a single patch. If you
want to merge this but you think it's better to split it into
several patches first, please tell me.

Change-Id: I2e2c4bb47f8d20e038d28e236e2ff813b30504af
2014-06-04 04:54:00 +00:00
Kunal Mehta 5e5993431b Fix incorrect usage of Title::newFromText
Change-Id: Icc69e47eae59653e4d8c3b227cccb7ea046e521b
2014-04-12 21:18:52 +00:00
jenkins-bot 48bd44a238 Merge "Add public setters for EchoEvent attributes" 2014-03-01 17:08:08 +00:00
Matthias Mullie b0c4e551fd Add some more clarification on why event_extra can't be too large
Change-Id: I3b366e06bb1980d834cad09c24dde929981ea366
2014-02-05 14:21:48 -08:00
bsitu 64afd78cbe Prevent events with large blob extra data
Change-Id: I8300abd3adeef863d181566072ab4163d1f0bcf3
2014-02-05 12:20:04 -08:00
Kunal Mehta fbd127fc88 Add public setters for EchoEvent attributes
So extensions can modify an event, like bug 57234.

Change-Id: I60b61d635eb3ab033dc9cc8d8bbf751e2221acc8
2013-11-29 22:20:03 -08:00
Kunal Mehta 2cc6171860 Add hooks for EchoEvent's
BeforeEchoEventInsert can be used to abort or modify an
EchoEvent before it is created. If aborted, EchoEvent::create
will return false.
EchoEventInsertComplete can be used to run stuff once it's
been created.

Change-Id: I376708ac7aafc419bf87bceeff6de7de9bdc2f4e
2013-09-30 13:21:56 -07:00
bsitu bca96e30ed Attempt to fix 'welcome notification' exception
It throws very randomly in job queue for enwiki, about 15 exceptions in 4 hours

Bug: 53425 

Change-Id: I1d7e45e33ffb8df1a91183e263daf007b0affc7f
2013-08-27 23:16:46 +00:00
bsitu 272b5bd50a Add replication delay handling to page-link formatter
If the job queue is not enabled to process web and email notifications,
there may be a replication delay in brand new link-from-page

Change-Id: I6e36e3fd015a582f4e85709282bdb70033fd1776
2013-08-22 15:21:52 -07:00
bsitu 2c74f66f18 Add HTML email support to Echo notification
To test the HTML email:

1. install the latest version of php-mail and php-mail-mime package, they are required
   by the core sendmail function to send HTML email
2. set $wgAllowHTMLEmail = true before loading Echo in LocalSetting.php

Change-Id: Ia4b98b14e135742b84f1b0e04589b0efdd24e954
2013-07-23 13:20:33 +02:00
kaldari 972e14672f New primary and secondary link behavior for Echo
See https://www.mediawiki.org/wiki/Echo/Feature_requirements#Flyout
and https://www.mediawiki.org/wiki/Echo/Feature_requirements#HTML_single_email_notifications

Also includes some related style changes per Vibha

Also removing feedback link from overlay since it's no longer needed

Change-Id: I94aed697e87126ed8ad6d1d416c99bafaa53ac53
2013-06-27 16:12:16 -07:00
Erik Bernhardson 34fbeaf8c9 Respect revision suppression within Echo
Update the echo formatter to properly display suppressed revision content

Bug: 48059
Change-Id: Iee3c9a41ad24c66b0e2abdd5f1375ebdbd74314e
2013-06-18 11:00:50 -07:00
jenkins-bot fea4484b68 Merge "Database updates for respecting oversight within Echo" 2013-06-11 00:01:02 +00:00
Erik Bernhardson f38ce97efd Database updates for respecting oversight within Echo
Provides the first step of adding and populating a new database field
for Echo oversight deployment.  The new field is populated via a
maintenance script and Event::loadFromRow will accept both new and old
results.  Everything will still run when the 2 now unused fields are
later dropped from the db.

Bug: 48059
Change-Id: I24d4b61a061f94ed9aaaa6087f33b2ab37f773cd
2013-06-10 14:52:18 -07:00
bsitu 71f250e0c6 (bug 47912) Visiting talk page should mark talk notif as read
This needs some more manual testing and adding unit testing

Change-Id: Iadfe3cf7927d5318f89ba17f067000f9399060af
2013-05-29 20:43:57 -07:00
bsitu e50f5a55a6 (bug 48821) Echo badge count always lags by 1
This bug was introduced during fixing the implicit database transaction,
the badge count logic happens before the transaction completes on idle,
moving the badge count code to only after a successful notification creation
should solve the issue

Change-Id: Ia564ed0d386e7cf2da1af3d23ae83d71ad472df5
2013-05-25 19:44:09 -07:00
bsitu 617488526b (bug 44247) Do not write to storage if read-only mode is on
Change-Id: I2e41cef0b5952c43cbba3374ac4da431b81c18ba
2013-05-14 13:48:05 -07:00
bsitu a98aaacf38 Add nextSequenceValue() to support dbs like PostGres
Change-Id: I7af8391fc88d0336b83dba449f52709f309b6833
2013-04-17 13:58:13 -07:00
bsitu 6a3624b0e4 Add web bundling function to Echo notification
* add web bundling feature
* unify event_timestamp with notification_timestamp
* remove echo_subscription
* update article_link to page_link notification with new logic
* remove duplicated function from MWDbEchoEmailBatch since it's defined in parent class

Change-Id: I2fa91c44edb020209b468fe13f894d9db3732e69
2013-04-04 10:53:46 -07:00
bsitu 8a02df15c5 Some cleanup to Formatter
* Move dismiss checking logic to event
* Remove unnecessary variables

Change-Id: If224fe6d668788e779109ee96ac28d44faa4b41b
2013-04-02 16:51:14 -07:00
Kaldari 9881a2a1ba Merge "Add more documentation and getter method to Notification" 2013-03-21 08:10:57 +00:00
bsitu 5c701f80ef Add getCategory() method to event object
Since every event is tied to a category, it's better for event object to have it as a member method

Change-Id: I911415284486bb11d13d91366340c5c330317c34
2013-03-18 16:30:39 -07:00
bsitu 9b1b6b09f1 Keep instance variable 'type' the same visibility as the others
1. Keep it as protected like the rest of the variables and there is an accessor method getType() for external access

2. Add some more documentation

Change-Id: I26b20e6b211a7dbfa96cf57eb87621698015646e
2013-03-14 12:14:43 -07:00
Kaldari 8357f4bd75 Implementing new prefs system for Echo
Change-Id: Id745ed6cf1c92695569597fab6ea662bac8c76c0
2013-03-05 12:20:17 -08:00
bsitu 605c88b4bb Add more documentation and getter method to Notification
Change-Id: Idb64de7034e7ff3c615dcee6fe814d64102f66cc
2013-03-04 17:34:23 -08:00
jenkins-bot 95f1d50c18 Merge "Add first version of EventLogging schema to Echo" 2013-03-03 03:45:46 +00:00
bsitu fc5c341692 Add first version of EventLogging schema to Echo
Change-Id: I4b6033ffc2ec8d1597f2b447f100c58a8c3a7f3e
2013-03-01 15:53:07 -08:00
Reedy 62a433573f Numerous bits of method parameter documentation
Change-Id: Ie4b2657b5e010311b779aa587aa7fa9fc3f19abb
2013-03-01 10:56:58 -08:00