Page MenuHomePhabricator

Remove the WatchstarGateway cache
Closed, ResolvedPublic3 Story Points

Description

Caching is complicated and should be avoided when possible. The WatchstarGateway currently implements a custom and error prone cache to avoid issuing redundant requests when searching for a page. For example, if a user types "ABCDEF" slowly and then presses backspace, the watchstar status for each result is already known and cached and so can be presented immediately. This task is to remove all of that cache code at the expense of this functionality. If wanted, a ticket may be opened against the underlying MediaWiki API so that the browser can do caching intelligently for us.

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/431021/

QA steps

Please test on the beta cluster.

  • Make sure watchstar is functional. It can show up in Special:Nearby, search and Special:Watchlist
  • Check that when the Special:Watchlist is rendered that no API requests are made to the server
  • When searching the API as a logged in user, there should be API hits for the watchstar on every keystroke

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 13 2018, 3:40 PM
Jdlrobson updated the task description. (Show Details)Jun 15 2018, 9:45 PM
Jdlrobson added a subscriber: Jdlrobson.

I don't see any downsides of doing this. If we decide to do caching we'd probably want to do it on the global level anyway. Let's remove this right away! Looks ready for estimation to me.

Vvjjkkii renamed this task from Remove the WatchstarGateway cache to e3aaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from e3aaaaaaaa to Remove the WatchstarGateway cache.Jul 2 2018, 12:25 PM
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

This code is quite fragile and it would be good to fix this sooner rather than later. Especially given the epic around asset bundling.

ovasileva set the point value for this task to 3.Jul 3 2018, 4:29 PM
Niedzielski moved this task from To Do to Doing on the Readers-Web-Kanbanana-Board-Old board.

Change 431021 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/MobileFrontend@master] WIP: Hygiene: remove the WatchstarGateway cache

https://gerrit.wikimedia.org/r/431021

Niedzielski removed Niedzielski as the assignee of this task.Jul 18 2018, 8:59 PM

@ovasileva, @Jdlrobson, I'm adding this to our MobileFrontend refactor spectacular task tree since this work seems to heavily support that effort. Please pop the task if you disagree!

Jdlrobson assigned this task to Ryasmeen.Aug 8 2018, 9:51 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Product-QA.
Jdlrobson added a subscriber: alexhollender.

Has skipped design review, cc @alexhollender

Change 431021 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Hygiene: remove the WatchstarGateway cache

https://gerrit.wikimedia.org/r/431021

@Jdlrobson: Was checking this on Beta cluster. Couple of questions:

  1. There is no API requests made to the server when I just load the Special:Watchlist, but there is one when I scroll down the page to reach the end of that list. Is that expected?
  1. When searching for pages, I am not getting API hits for the watchstar on every keystroke when I type really fast. Should it not behave the same way?

There is no API requests made to the server when I just load the Special:Watchlist, but there is one when I scroll down the page to reach the end of that list. Is that expected?

Perfect. The api request at the end of the page is pulling down the next page.

When searching for pages, I am not getting API hits for the watchstar on every keystroke when I type really fast. Should it not behave the same way?

The request for watchstar should only happen if you are logged in and there are search results listed.
On https://en.m.wikipedia.beta.wmflabs.org/wiki/Transcluded_page#/search I see 2 api requests if I search for "Sa" (1 for results, 1 for watchstar). Does that help?

@Jdlrobson: I see, yeah that makes sense. There was indeed no search results when I typed the first two characters fast, and therefore I got only 1 api request for watchstar and 1 for results, even though I typed three characters.

Cool! This is good to go then from my side.

ovasileva closed this task as Resolved.Aug 9 2018, 9:57 AM

Looks good. Thanks all!

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptAug 21 2018, 12:47 AM