Page MenuHomePhabricator

hCaptcha risk scores (MobileFrontend): Load ext.confirmEdit.hCaptcha when a block message is shown
Closed, ResolvedPublic1 Estimated Story Points

Description

MobileFrontend's blockMessageDrawer already has code for tracking when a block is shown.

Once we add support for loading hCaptcha's frontend module unconditionally, we may trigger a hook from blockMessageDrawer that would be handled by ConfirmEdit to submit hte risk score.

I have identified two cases when a block notice is shown when the MF is active:

  • Accessing a page directly when you have a block (i.e. http://host/w/index.php?title=New_Page&action=submit)
    • This is already covered by the same codepath used by the desktop editor: page loads, BeforePageDisplayHookHandler detects the block and loads hCaptcha FE modules
  • Clicking on the edit icon while reading a page
    • This required adding new hooks

Event Timeline

hector.arroyo renamed this task from hCaptcha risk scores: Load ext.confirmEdit.hCaptcha when a block message is shown to hCaptcha risk scores (MobileFrontend): Load ext.confirmEdit.hCaptcha when a block message is shown.Thu, May 21, 8:49 AM
hector.arroyo changed the task status from Open to In Progress.
hector.arroyo set the point value for this task to 1.

Change #1290720 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/MobileFrontend@master] hcaptcha: Support loading additional frontend modules from bock messages

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

Change #1290753 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Support for collecting resk scores for blocks from the MobileFrontend

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

Change #1290720 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] hcaptcha: Support loading additional frontend modules in block messages

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

Change #1295484 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/ConfirmEdit@master] hCaptcha risk scores: VE plugin to collect risk scores for block notices

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

Change #1290753 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Collect risk scores from MobileFrontend events

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

Change #1295484 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hCaptcha risk scores: VE plugin to collect risk scores for block notices

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

Change #1297536 had a related patch set uploaded (by Kosta Harlan; author: Harroyo-wmf):

[mediawiki/extensions/ConfirmEdit@wmf/1.47.0-wmf.5] hCaptcha risk scores: VE plugin to collect risk scores for block notices

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

Change #1297536 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.47.0-wmf.5] hCaptcha risk scores: VE plugin to collect risk scores for block notices

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

Mentioned in SAL (#wikimedia-operations) [2026-06-04T07:25:09Z] <kharlan@deploy1003> Started scap sync-world: Backport for [[gerrit:1297536|hCaptcha risk scores: VE plugin to collect risk scores for block notices (T426943)]], [[gerrit:1297200|hCaptcha: Render a fresh mobile widget for each captcha attempt (T425929)]], [[gerrit:1297173|hCaptcha: Enable risk-score collection for users blocked by IP blocks (T424629)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-04T07:27:12Z] <kharlan@deploy1003> kharlan, harroyo-wmf: Backport for [[gerrit:1297536|hCaptcha risk scores: VE plugin to collect risk scores for block notices (T426943)]], [[gerrit:1297200|hCaptcha: Render a fresh mobile widget for each captcha attempt (T425929)]], [[gerrit:1297173|hCaptcha: Enable risk-score collection for users blocked by IP blocks (T424629)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwd

Mentioned in SAL (#wikimedia-operations) [2026-06-04T07:34:05Z] <kharlan@deploy1003> Finished scap sync-world: Backport for [[gerrit:1297536|hCaptcha risk scores: VE plugin to collect risk scores for block notices (T426943)]], [[gerrit:1297200|hCaptcha: Render a fresh mobile widget for each captcha attempt (T425929)]], [[gerrit:1297173|hCaptcha: Enable risk-score collection for users blocked by IP blocks (T424629)]] (duration: 08m 56s)

Change #1297623 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Add missing param type in jsDoc block

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

Change #1297623 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Add missing param type in jsDoc block

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

This is working as expected (tested locally with the master branches of the MobileFrontend and ConfirmEdit).

image.png (1,330×795 px, 161 KB)
image.png (1,359×804 px, 205 KB)