Page MenuHomePhabricator

[betalabs] MentorDashboard: "TypeError: log is not a function" error when clicking on info icon
Closed, ResolvedPublic

Description

Steps:

  1. On betalabs go to Special:MentorDashboard
  2. In "Send praise" module click on the info buttons - the Console error will be produced on opening and closing the info popup.

Screen Shot 2023-04-28 at 3.45.19 PM.png (1,210×740 px, 114 KB)

TypeError: log is not a function
    at onOpen (eval at Fp (load.php?lang=en&modules=ext.growthExperiments.MentorDashboard%2Cicons%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%2Cvue%2Cvuex%7Cmediawiki.language.names%7Cmediawiki.widgets.UserInputWidget%7Coojs-ui.styles.icons-editing-core%2Cicons-interactions%2Cicons-moderation%2Cicons-movement%2Cicons-user&skin=vector&version=3wapo:665:801), <anonymous>:53:28)
TypeError: log is not a function
    at onClose (eval at Fp (load.php?lang=en&modules=ext.growthExperiments.MentorDashboard%2Cicons%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%2Cvue%2Cvuex%7Cmediawiki.language.names%7Cmediawiki.widgets.UserInputWidget%7Coojs-ui.styles.icons-editing-core%2Cicons-interactions%2Cicons-moderation%2Cicons-movement%2Cicons-user&skin=vector&version=3wapo:665:801), <anonymous>:96:29)

Note:

  • the error is present in Vector 2022 and Vector legacy
  • the error is present with opened/hidden side menus

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 913967 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] CScoreCards: Move logging responsibility upper in the stack

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

Urbanecm_WMF triaged this task as Low priority.
Urbanecm_WMF moved this task from New Tasks to In Progress on the GrowthExperiments-Mentorship board.

Thanks @Etonkovidova for filling this task. The issue is caused by no frontend instrumentation present in the Mentor dashboard and as such, by the log function being undefined. This didn't break anything (the events which called the non-existent log functions were analytics-only, serving no user-visible feature), but we should fix the console error regardless. Uploaded a patch that moves the logging responsibility away from the shared component (namely, to NewImpact.vue, where the existence of the log function can be safely assumed). Moving to Code Review.

Note: When verifying this task, it would be helpful to ensure the instrumentation itself continues to work (opening and closing the tooltips should be visible in event logging data), as the proposed fix touches this area of code.

Change 913967 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] CScoreCards: Move logging responsibility upper in the stack

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

Checked enwiki betalabs and testwiki wmf.9 - the error is not present.