Page MenuHomePhabricator

Items created through QuickStatements don't get added to Watchlist on wikidata.org
Closed, DuplicatePublic

Description

I have checked "Add pages I create and files I upload to my watchlist" in my local Preferences on Wikidata; however, when I create new items through QuickStatements (https://tools.wmflabs.org/quickstatements/#/), they don't get added to my watchlist.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Items created through QuickStatements don't get added to Watchlist to Items created through QuickStatements don't get added to Watchlist on wikidata.org.Apr 19 2020, 5:47 PM
Addshore subscribed.

I tried this out on test using the special page and API and both items that I created were added to my watchlist as expected.
I also briefly looked at the code and dont imediatly see a bug.

Can you link to some of the edits made by quick statements that you would expect to cause the page to be watched? So that we can see which edit and api module is being used.

For me the same issue occurs. Saturday I created Q91025771 and it's not on my watchlist, while new items I create using Wikidata website are being added to my watchlist.

Looking at https://www.wikidata.org/w/index.php?title=Q91025771&action=history this was just created using wbeditentities
From the short investigation that I already did in this code area it really looks like they should be added.

I don't know how OAuth might interact with this.
I'll note that the "grants" for quickstatements are as follows:

image.png (201×370 px, 9 KB)

And they do not include the grants for:

  • View your watchlist
  • Edit your watchlist

This might have something to do with it?

However the following page makes me think not: https://meta.wikimedia.org/wiki/Special:ListGrants#editmywatchlist

Edit your own watchlist. Note some actions will still add pages even without this right. (editmywatchlist)

Addshore added a subscriber: Lydia_Pintscher.

Looking a tiny bit deeper than I did in T250621#6070573 the code path that is taken goes through:

WikiPageEntityStore::updateWatchlist and then watches the page via WatchAction::doWatch
WatchAction::doWatch has a permission check, which I imagine fails due to the oauth grants

	public static function doWatch(
		Title $title,
		User $user,
		$checkRights = User::CHECK_USER_RIGHTS,
		?string $expiry = null
	) {
		$permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
		if ( $checkRights && !$permissionManager->userHasRight( $user, 'editmywatchlist' ) ) {
			return User::newFatalPermissionDeniedStatus( 'editmywatchlist' );
		}

Either:

  • The desired behaviour is that in this situation watches should work (question for @Lydia_Pintscher)
  • OR that oauth tools that expect to be able to watch when editing should have the grant.

I suspect the answer is point 1, and that will need a fix in wikibase!

Just saw this one. I think fixing wikibase to add to watchlist is the way to go. I could update the OAuth permissions but that would break everyone's server-based edits as they would use an old OAuth, correct?

I believe this is fixed now with the work that we did in T217144 :)