Page MenuHomePhabricator

Number of watching users per page to be shown on recent changes view (finished)
Closed, ResolvedPublic

Description

Together with my enotif patch (see
http://bugzilla.wikipedia.org/show_bug.cgi?id=454 ) I introduced the possibility
of having the number of watching users shown next to the page title in the
recent changes view.

A new message page MediaWiki:number_of_watching_users is introduced, which is
preset with '($1 watching user/s)' in module Language.php during fresh or
upgrade installations.

'$1' is replaced with the number of watching users.
The text is only is only shown, if the number is > 0 .


Version: 1.5.x
Severity: enhancement
URL: http://meta.wikimedia.org/wiki/Email_notification_versions

Details

Reference
bz727

Related Objects

StatusSubtypeAssignedTask
InvalidAklapper
InvalidNone
ResolvedNone
InvalidWikinaut
ResolvedNone
ResolvedWikinaut
ResolvedNone
ResolvedNone
DeclinedNone
ResolvedNone
ResolvedNone
ResolvedWikinaut
DeclinedNone
DeclinedNone
ResolvedNone
DeclinedNone
DeclinedAklapper
ResolvedNone
ResolvedNone
ResolvedNone
Resolvedhashar
Resolvedhashar
Resolvedhashar
ResolvedNone
ResolvedNone
Resolvedhashar
Resolvedhashar
Resolvedhashar
Resolvedhashar
ResolvedNone
ResolvedNone
Resolvedhashar
ResolvedNone
DeclinedWikinaut
ResolvedWikinaut
ResolvedWikinaut

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 7:00 PM
bzimport set Reference to bz727.
bzimport added a subscriber: Unknown Object (MLST).

bugzilla_wikipedia_org.to.jamesd wrote:

How is the number of watchers cached, for logged in and not logged in viewers?
When it has to be read fromthe database, it read from a database slave?
Watchlist doesn't currently have an efficient key for this (namespace, title is
the closest: too big). Does this add a more efficient non-unique article ID key
so the count can be found in an index which easily fits in cache RAM?

(In reply to comment #1)

How is the number of watchers cached, for logged in and not logged in viewers?
When it has to be read fromthe database, it read from a database slave?
Watchlist doesn't currently have an efficient key for this (namespace, title is
the closest: too big). Does this add a more efficient non-unique article ID key
so the count can be found in an index which easily fits in cache RAM?

Dear Jamesday, at this moment, I admittedly did not take care about these
efficiency issues and use straight MySQL calls. This stems from the fact, that I
learnt to understand the MediaWiki code since January - in order to implement
enotif - and personally find that there is an inherent lack of documentation,
especially with respect to the cache and other efficiency-improving changes in
the last versions, which makes it difficult for MediaWiki-Developer-newbie to
fulfill _all_ requirement just at the beginning. Now, after having programmed
and checked the functionality, I wish to learn from you how to improve my
ameliorations to the project. Here are my answers, as far as I can give them.

As you perhaps know, I have implemented and published the enoitf patch see
http://bugzilla.wikipedia.org/show_bug.cgi?id=454 and it can be important to get
an indication, how many mails will be sent out (= number of watching users,
currently. Later, as a digest per timezone, see http://meta.wikipedia.org/Enotif ).

The following code sniplet is from the recent enotif 1.21 published on Oct. 16,
2004 (see that bugzilla 454). The enotif is for mw1.3.6 and I currently port the
changes to CVS 1.4 version.

The core of counting the watching numbers is in module SpecialRecentchanges.php:

sql3=SELECT COUNT(*) AS numberofwatchingsusers FROM watchlist WHERE
wl_title={$obj->rc_itle} AND wl_namespace={$obj->rc_namespace}
res3=$dbr->query(sql3)
call recentChangesLine(....., numberofwatchingusers)

And some modifications in recentChangesLineOld and ..New in Skin.php are needed.

Bruce has very early proposed to me to use a new index (namespace+title), which
I perhaps implement soon for watchlist. See the old mail in a top position in my
public to-do list, which is
http://meta.wikimedia.org/wiki/Email_notification_to-do_list#using_namespace_title_as_index_.28as_proposed_here.29

I hope, I have given (a admittedly lenghty, pls. apologize) an explanation,
which I did (first functionality) and what I plan to do (efficiency improvements)

Tom Gries
Berlin

The number of watching users is shown on recent changes page, watchlist and
article page footers.

Enotif versions > 1.32 have this built in and allow any user to disable the
number display. Currently, the numbers are shown in brackets at the last item on
recentchanges lines, such as [5]

Reopening, as this feature is not (yet) in MediaWiki, but rather in a third-party patch under
development which has not (yet) been included.

Closed now. The display of the number of watching users on recent changes view,
watchlist and article page footers depends on two variables in DefaultSetting.php:

$wgRCShowWatchingUsers (*)
$wgPageShowWatchingUser

(*) User preferences page shows an corresponding option for the user where the
user can opt-out or opt-in. (The option is only shown, if the DefaultSettings
option $wgRCShowWatchingsUsers is true.)

After a fresh installation, both options are disabled. To see the number, you
need to enable one or both (in DefaultSettings.php). As long as the both
variables are set to false, the necessary database requests for retreiving the
number of watching users are skipped.