Page MenuHomePhabricator

Event logging subscriber is being bound on every call
Closed, ResolvedPublic2 Estimated Story Points

Description

After T300245: Log when the infobox is expanded or collapsed, the log function calls mw.trackSubscribe on every log, rebinding the listener and causing a compounding number of events to be sent as ip interactions occur. mw.trackSubscribe should only be called once.

To reproduce:

  1. Click on a lot of ip popups on the same page
  2. Observe that 1 event gets sent, then 3, then 5, and so on

AC:

  • only one event should be sent per action

Event Timeline

Change 771330 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/IPInfo@master] Stop subscribing to listeners on every log() call

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

Change 771330 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Stop subscribing to listeners on every log() call

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

One event shows per an IP Info box that is clicked to open popup. If you click the same IP info box to pop open again, no additional events is generated.

Screen Shot 2022-03-22 at 11.30.41 PM.png (1×2 px, 755 KB)

Below one log for each action although the user clicked IP info popup more than once

Screen Shot 2022-03-23 at 3.41.30 PM.png (1×2 px, 676 KB)