Page MenuHomePhabricator

Leveling up: Off-by-one error for edit-count-for-task-type in impression event
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Make enough edits to trigger the "try new task" panel
  • Observe the impression event for the try new task panel

What happens?:

The event looks like this:

{
	"event": {
		"action": "trynewtask-impression",
		"action_data": "next-suggested-task-type=links;edit-count-for-task-type=4",
		"context": "postedit-trynewtask",
		"editor_interface": "visualeditor",
		"help_panel_session_id": "066f72d5882382588f68",
		"is_mobile": false,
		"is_suggested_task": true,
		"page_id": 0,
		"page_ns": 0,
		"page_protection": "",
		"page_title": "",
		"session_token": "{removed}",
		"user_can_edit": true,
		"user_editcount": 21,
		"user_id": 23688
	}
}

What should have happened instead?:

The event should show 5 edits for copyedit:

{
	"event": {
		"action": "trynewtask-impression",
		"action_data": "next-suggested-task-type=links;edit-count-for-task-type=5",
		"context": "postedit-trynewtask",
		"editor_interface": "visualeditor",
		"help_panel_session_id": "066f72d5882382588f68",
		"is_mobile": false,
		"is_suggested_task": true,
		"page_id": 0,
		"page_ns": 0,
		"page_protection": "",
		"page_title": "",
		"session_token": "{removed}",
		"user_can_edit": true,
		"user_editcount": 21,
		"user_id": 23688
	}
}

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change 900657 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] PostEdit: Increment the edit-count-for-task-type count

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

Change 900657 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] PostEdit: Increment the edit-count-for-task-type count

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

Change 900685 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.27] PostEdit: Increment the edit-count-for-task-type count

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

Change 900685 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.40.0-wmf.27] PostEdit: Increment the edit-count-for-task-type count

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

Mentioned in SAL (#wikimedia-operations) [2023-03-20T20:47:50Z] <kharlan@deploy2002> Started scap: Backport for [[gerrit:901146|TryNewTask: Set an array fallback if TryNewTaskOptOuts is null]], [[gerrit:900685|PostEdit: Increment the edit-count-for-task-type count (T332319)]], [[gerrit:900684|LevelingUpManager: Handle links/link-recommendation collision (T332309)]]

Mentioned in SAL (#wikimedia-operations) [2023-03-20T20:49:27Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:901146|TryNewTask: Set an array fallback if TryNewTaskOptOuts is null]], [[gerrit:900685|PostEdit: Increment the edit-count-for-task-type count (T332319)]], [[gerrit:900684|LevelingUpManager: Handle links/link-recommendation collision (T332309)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmn

Mentioned in SAL (#wikimedia-operations) [2023-03-20T20:58:18Z] <kharlan@deploy2002> Finished scap: Backport for [[gerrit:901146|TryNewTask: Set an array fallback if TryNewTaskOptOuts is null]], [[gerrit:900685|PostEdit: Increment the edit-count-for-task-type count (T332319)]], [[gerrit:900684|LevelingUpManager: Handle links/link-recommendation collision (T332309)]] (duration: 10m 28s)

This change is now in wmf.27, so removing from release blockers. cc @Etonkovidova

Checked testwiki wmf.2 - when the try new task post edit dialog appears, the event looks correct:

{
	"event": {
		"action": "trynewtask-impression",
		"action_data": "next-suggested-task-type=copyedit;savedTaskType=update;edit-count-for-task-type=5"
		"context": "postedit-trynewtask",
		"editor_interface": "visualeditor",
		"help_panel_session_id": "7822845e9787212e7bec";
		"is_mobile": false,
		"is_suggested_task": true,
		"page_id": 0,
		"page_ns": 0,
		"page_protection": "",
		"page_title": "",
		"session_token": "{removed}",
		"user_can_edit": true,
		"user_editcount": 54,
		"user_id": 50416
	}
}