Page MenuHomePhabricator

Use local storage VUEX to reduce fetchZKeys requests
Closed, ResolvedPublic

Description

As a developer I would like the request made to fetch information about zIds to make use of the current VUEX store, so that the request is just made if a zIds is not already present in the store.

Event Timeline

Notice that this already happens in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLambda/+/refs/heads/master/resources/ext.wikilambda.edit/components/ZObjectKeyList.vue#166 and https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikiLambda/+/refs/heads/master/resources/ext.wikilambda.edit/components/ZObjectGeneric.vue#164

However with that type of check we can just know that the requested ZIDs are or will appear on the state once the fetch request is over, but on ZObjectSelector and ZReference we need to take immediate action with the response. I've been thinking whether we should take the check inside of fetchZKeys instead of handling it in the components, maybe then we guarantee that the promise resolution will For Sure contain the requested ZID, in case a component needs to listen for that.

I personally think we should move it in VUEX and it should be handled by fetchzZIDs.

The scope of "fetchingZID, and zIDs" is there, so I think the funcitonality should really live in vuex. (we can return whatever we want, so that for the FE is the same, but we save Server request)

Agreed, sounds good! Thanks :D

Lindsaykwardell subscribed.

This task will be much easier to accomplish once the new zobject parsing is in place.

DVrandecic triaged this task as Lowest priority.Apr 7 2021, 4:56 AM
DVrandecic raised the priority of this task from Lowest to High.Apr 21 2021, 4:30 PM

Change 682617 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/WikiLambda@master] Use local storage VUEX to reduce fetchZKeys requests

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

Change 682617 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Use local storage VUEX to reduce fetchZKeys requests

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