Page MenuHomePhabricator

Send `disabled` event in PagePreviews JS module
Closed, DeclinedPublic

Description

T167365 implements disabled event handling via PHP. When a user hits "save" on preferences form PHP listens to changes. When a user disables Page Previews PHP triggers event to EventLogging system.

This approach has one downside, we cannot pass all required event data:

  • previewCountBucket
  • sessionToken

Those variables are available only in the browser and there is no easy way to pass it to the backend. Because of that, we would like to trigger the disabled event in Popups codebase after the user saves preferences.

Developer notes:

  • create a separate small module that loads only on Special:Preferences page and listens for changes
  • trigger the disabled event when user disables Page Previews

Event Timeline

What is the value statement of doing this? Not sure what the priority of this is... but feels low.

Ping @phuedx - can you help work out what to do with this card? I don't want it to linger in the backlog for several years but also don't want us to work on this if it's not useful.

I've updated the Popups schema to note that the tokens sent with the disabled event shouldn't be relied on when the user is logged in (event.isAnon = false). If this becomes unacceptable at some later date, then we can either revive this task or write another.