Page MenuHomePhabricator

undefined is not an object (evaluating 'context.state.filterValues[options.type].assessment')
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
undefined is not an object (evaluating 'context.state.filterValues[options.type].assessment')
exception.trace
at search https://commons.m.wikimedia.org/w/load.php?lang=en&modules=jquery%2Cmediasearch&skin=minerva&version=17dg0:247:416
at https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image#/search:198:750
at https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image#/search:200:459
at getMoreResultsForTabIfAvailable https://commons.m.wikimedia.org/w/load.php?lang=en&modules=jquery%2Cmediasearch&skin=minerva&version=17dg0:205:758
at He https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image#/search:215:236
at He https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image#/search:215:236
at https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image#/search:238:240
at intersectionCallback https://commons.m.wikimedia.org/w/load.php?lang=en&modules=jquery%2Cmediasearch&skin=minerva&version=17dg0:191:199
Impact

No user-facing impact observed thus far

Notes

28 occurrences since yesterday post-train. May be a result of the switch from WMBI to MediaSearch.

Details

Request URL
https://commons.m.wikimedia.org/w/index.php?search=[search term]&title=Special:MediaSearch&type=image

Event Timeline

I have not yet been able to reproduce this error, but here's what I know about it:

  • has been happening ~30x/day ever since June 9 (this was when the assessment feature went live after a config patch I believe).
  • all occurrences are on the mobile site
  • seems to be happening on general searches that don't have the assessment filter enabled

Still seems pretty low-impact. Even though I don't know *why* the value of context.state.filterValues[ options.type ] is undefined in these cases, one potential way to fix would be to update the conditional that checks for assessment to first ensure context.state.filterValues[ options.type ] is always an object. This should be the case already, because the filterValues state for each media type is stored in Vuex and can only be changed via the mutations we have defined (which add or remove keys from objects but never assign a different type of value)...

Just as a learning opportunity, I have also looked around the code to see how things are set and what could trigger the above message. (this was very helfup to see the syntax used and the data flow! :) )

As Eric said, the code is well defined, and I could not see any possible instanced that would mark the "filterValues" as undefined (the only way to trigger the above error).

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

[mediawiki/extensions/MediaSearch@master] Solve issue when FilterValues.assessment is undefined

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

Change 704499 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Solve issue when FilterValues.assessment is undefined

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

Etonkovidova subscribed.

Checked on commons wmf.15 - the error is not present.