Page MenuHomePhabricator

Changes that occur between sitelink and wikibase-addUsagesForPage do not get dispatched to the unsubscribed client
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Deploy a MediaWiki installation with Wikibase
  • Configure the deployment to not run the wikibase-addUsagesForPage job
  • Create an article that displays a property from a sitelinked Item
  • Sitelink the article to the item
  • Confirm the article shows the property's value
  • Change the property's value on the sitelinked Item
  • Note that the article does not update to the new value
  • Manually run the wikibase-addUsagesForPage job
  • Note that the article still does not update to the new value

What happens?:

When dispatching changes, only subscribed clients and clients being sitelinked in the specific change being dispatched receive the update. Subscription happens in a separate job from sitelinking, so there is a window of time where changes will not be dispatched to a client that needs to receive the changes and update the Article.

What should have happened instead?:

The client should have received the changes and update the Article.

Software version (skip for WMF-hosted wikis like Wikipedia):

MediaWiki 1.39.0-rc.0
Wikibase REL1_39

Other information (browser name/version, screenshots, etc.):

It seems like the easiest solution would be to always dispatch to sitelinked clients, regardless of subscription status. However, if there are many sitelinks without subscriptions, this would significantly increase the number of unneeded dispatches to clients. So I'm not sure if that's a good approach here or not.

A potential mitigation would be to run the wikibase-addUsagesForPage separately and much more often to minimize the window between sitelinking and subscription.

Event Timeline

This is likely another thing that could go wrong with dispatching a la T291063

CtrlZvi renamed this task from Changes that occure between sitelink and wikibase-addUsagesForPage do not get dispatched to the unsubscribed client to Changes that occur between sitelink and wikibase-addUsagesForPage do not get dispatched to the unsubscribed client.Sep 25 2022, 5:22 PM

Thinking out loud here, could we potentially add all pre-existing subscriptions for a client as a deferred action when the client is added instead of as a job? And do that before creating the DispatchChanges job?

More thinking outloud, I think there's an even easier solution. Subscribing is already a client-side action. So upon subscription, since the client knows that it may have missed changes between site link and subscription, we just invalidate the cache. That way, the next view will rerender and will pick up any missed changes. I'm working on testing this now, but there's some subtleties involved, and my understanding of how caching, refreshing links, subscriptions, changes, etc. all interact is still very new.