Page MenuHomePhabricator

Instrument new comment notification
Closed, ResolvedPublic

Description

T250295 introduces a notice within the Reply Tool that appears when a new comment is posted in the discussion people are currently drafting a reply within.

As part of designing and implementing T250295, we made assumptions about how to balance the following tensions:

  1. Make people aware of the alert's presence without distracting them from the comment they are drafting
  2. Inform people they have the option to engage with the alert without feeling obligated to do so

This task involves the work with instrumenting said alert so that we can evaluate the extent to which we've balanced the "tensions" above effectively.

Use cases

This instrumentation is designed to help us answer the following: "Are people finding the new comment notifications useful?"
Potential metrics:

  • At what rate do people engage with the new comment alerts they are shown?
  • What percentage of people decide to update the page to see the latest comments that have been posted?
  • What percentage of people make changes to the comment they had been drafting after updating the page to see the latest comments that have been posted?
  • How often people do people dismiss the new comment alerts they are shown?
    • This question depends on "dismiss" functionality being included in the alerts. See ===Open questions in T300560.

Requirements

Done

  • The instrumentation that is needed to fulfill the ===Use Cases listed above are documented in the ===Requirements section

Reference

To see this new functionality in action, please follow these steps...

  1. Visit an old revision of a talk page (e.g. Talk:Douglas Adams)
  2. Click the [ reply ] link that appears on the first comment in the == Contradicting statements regarding death== section
  3. Start typing a comment
  4. Wait 10-30 seconds
  5. Notice the "⚠️ 1 new comment has been added in this section. Click to reload." alert appears beneath the Reply Tool's text input
  6. Click the "⚠️ 1 new comment has been added in this section. Click to reload." to reveal the new comments that have been posted
  7. ✅ That's it

Event Timeline

ppelberg moved this task from Incoming to Upcoming on the Editing-team (Kanban Board) board.
ppelberg moved this task from Backlog to Triaged on the DiscussionTools board.
Esanders renamed this task from Instrument new comment notificaiton to Instrument new comment notification.Feb 21 2022, 11:02 PM

Absent other needs, it'd be simple to drop this into visualeditorfeatureuse. (Already tied to the edit session, etc.)

Suggested events, all with feature notificationNewComments:

  • show: when it appears
  • page-update: when new comments are loaded from the notification
  • close: when it's dismissed, assuming that's available

I'd probably need to double-check that the edit session ID is persisted through the comment-refresh. (It definitely won't be across an outright page-reload, which is an issue with this logging on mobile.) Assuming that works, you'll probably get the "making changes" data just for checking for anything VEFU after the refresh.

kzimmerman triaged this task as Medium priority.Jul 19 2022, 5:26 PM
kzimmerman moved this task from Triage to Current Quarter on the Product-Analytics board.

All of the events and event names proposed by @DLynch in T301582#7735903 look good to me. These events will allow us to measure all the proposed metrics identified in the task description except for the following:

What percentage of people make changes to the comment they had been drafting after updating the page to see the latest comments that have been posted?

@DLynch - Will a new editing session be created after the page is updated to see the latest comments? Assuming that's not the case, calculating this metric will not be feasible with the current instrumentation. Within a single editing session, we track when a user starts typing (event.action = 'firstChange') but do not track subsequent typing activity so we will not know if someone made additional edits to a current draft after updating the page.

We could look at the percentage of users (or editing sessions) that saved their replies after engaging with the new comment notification with the current instrumentation.

@MNeisler Sorry for the slow response here. Currently whenever you init a widget it resets the session ID -- this includes when the widget is recreated for the update, because internally that's basically done just by replacing the entire talk page contents and then letting the autosave-recovery do its work. As such you would see two sessions, one which ends with an interaction with the new comment notification in VisualEditorFeatureUse, and then immediately-after another which has its own init and firstChange.

Change 857713 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/DiscussionTools@master] Track events for the new comment notice

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

image.png (330×616 px, 59 KB)

image.png (328×622 px, 61 KB)

...and my vm froze while loading for the close one. I'll get back to that. :D

Also, @MNeisler, I noticed that the way the page is refreshed skips the normal abort event in editattemptstep. Should I fix this, or is it okay-for-the-situation?

Change 857713 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Track events for the new comment notice

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

@MNeisler Sorry for the slow response here. Currently whenever you init a widget it resets the session ID -- this includes when the widget is recreated for the update, because internally that's basically done just by replacing the entire talk page contents and then letting the autosave-recovery do its work. As such you would see two sessions, one which ends with an interaction with the new comment notification in VisualEditorFeatureUse, and then immediately-after another which has its own init and firstChange.

@DLynch Thanks, that helps clarify. For the first session that ends with the interaction with the new comment notification, I'm assuming that this would look like an incomplete edit session because there would be an init saved without a subsequent saveSuccess. I don't think it would impact our overall edit completion rate metrics too much but am thinking through the best way to filter out these events if needed when calculating edit completion rates.

Options:

  • I could currently look for any sessions that engaged with a widget by joining with VisualEditorFeatureUse.
  • We could add a new action in EditAttemptStep to specifically log instances where a session is reset due to interaction with a widget. Do you think that's feasible?

Also, @MNeisler, I noticed that the way the page is refreshed skips the normal abort event in editattemptstep. Should I fix this, or is it okay-for-the-situation?

I think that's fine for this situation. I'm also not sure if this should be grouped into the abort event and am wondering if it would be worth adding a new event for this per my comment above

For the first session that ends with the interaction with the new comment notification, I'm assuming that this would look like an incomplete edit session because there would be an init saved without a subsequent saveSuccess.

Yup, it should just vanish suddenly. Well, now it'll vanish after that page-update event in visualeditorfeatureuse, so it'll be detectable if you dig for it.

We could add a new action in EditAttemptStep to specifically log instances where a session is reset due to interaction with a widget. Do you think that's feasible?
[...]
I'm also not sure if this should be grouped into the abort event and am wondering if it would be worth adding a new event for this per my comment above

I think an abort variant makes sense with what's already there -- what's happening here is basically a variant on the existing switch abort-types, after all.

hi @DLynch - Sorry for the delayed response.

I think an abort variant makes sense with what's already there -- what's happening here is basically a variant on the existing switch abort-types, after all.

Agreed - I think this makes sense as an abort type event. Can we fix the instrumentation to add an event.action = 'abort' to be sent when the page is refreshed?

It would be also useful to add a new abort type to distinguish this event from other abort types including switch.

I was thinking event.abort_type = 'pageupdate'.
Description: User is updating the page during an edit

Let me know if you have any other suggestions or questions. Thanks!

Change 903845 had a related patch set uploaded (by DLynch; author: DLynch):

[schemas/event/secondary@master] EditAttemptStep: Add a new abort type for page updates

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

Change 903846 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/WikimediaEvents@master] Bump EditAttemptStep schema version to 1.3.2

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

Change 903847 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/DiscussionTools@master] Log an EditAttemptStep session-abort when refreshing the page contents

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

Example event with the new abort type:

image.png (642×644 px, 109 KB)

Change 903845 merged by jenkins-bot:

[schemas/event/secondary@master] EditAttemptStep: Add a new abort type for page updates

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

Change 903846 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Bump EditAttemptStep schema version to 1.3.2

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

Change 903847 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Log an EditAttemptStep session-abort when refreshing the page contents

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

DLynch updated Other Assignee, added: DLynch.

@MNeisler if you could verify that the logging is happening as you'd desire

@DLynch Thanks for the ping.

All the new instrumentation for this new feature appears to be logging as expected. See summary of checks and some initial data from the QA below.

New comment notice events

  • All of the events for the new comment notice are being logged as expected in visualeditorfeatureuse

Total events logged for the new comment notice event.feature = 'notificationNewComments) since changes deployed

actionn_eventsn_usersn_sessions
close693416692
page-update12853295012839
show33354554729009
  • There are more action=show events than other event types as expected. New comments are reloaded (action = page-update) for about 44% of the editing sessions where the new comment notification is shown and the notice is dismissed about 2% of the time.
  • Events have currently been logged at 129 distinct wikis
  • The majority of events are associated with integration = discussiontools as expected. Only 4 events logged with integration = page.
  • Events logged by both logged-in (92%) and logged-out users (8%).
  • The majority of events (93%) have been logged on desktop so far (7% platform = phone)

New abort type for page update events

  • New abort_type = 'pageupdate' is logging as expected with all expected associated events

Summary of events logged since new instrumentation deployed

abort_typen_eventsn_usersn_sessions
pageupdate19507831950
  • Logged on both desktop (91% of editing sessions with this abort type) and phone platforms (9% of editing sessions with this abort type)
  • 100% of these events have occurred with the discussiontools integration.
  • Was able to join these abort type events with the new comment notice events logged visualeditorfeatureuse

Going ahead and marking this as resolved but please reopen if needed