Page MenuHomePhabricator

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


undefined is not an object (evaluating 'context.state.filterValues[options.type].assessment')
at search
at[search term]&title=Special:MediaSearch&type=image#/search:198:750
at[search term]&title=Special:MediaSearch&type=image#/search:200:459
at getMoreResultsForTabIfAvailable
at He[search term]&title=Special:MediaSearch&type=image#/search:215:236
at He[search term]&title=Special:MediaSearch&type=image#/search:215:236
at[search term]&title=Special:MediaSearch&type=image#/search:238:240
at intersectionCallback

No user-facing impact observed thus far


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


Request URL[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

Change 704499 merged by jenkins-bot:

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

Etonkovidova subscribed.

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