Page MenuHomePhabricator

hCaptcha: Log challenge event as "saveFailure" in EditAttemptStep
Closed, ResolvedPublic

Description

Summary

We need to include the presentation of hCaptcha challenges in EditAttemptStep's event logging data. @DLynch proposed that we log the appearance of the challenge as a saveFailure event.

Acceptance criteria

  • When the user sees the hCaptcha visual/textual challenge as part of an edit workflow, there is a saveFailure event recorded in the EditAttemptStep event logging data

Event Timeline

This event should also express if the challenge was shown via AbuseFilter’s showcaptcha consequence.

This should be a good semantic fit with the existing usage of saveFailure, because my understanding of the hCaptcha flow is that it'll show the captcha after the user clicks to publish their edit. This aligns with how the already-present ConfirmEdit captchas work, just without the same cycle through the page-request flow.

AFAICT, this should be:

mw.track( 'editAttemptStep', {
	action: 'saveFailure',
	message: 'hcaptcha', // Or 'hcaptcha_always_challenge' if that SiteKey is in use
	type: 'captchaExtension'
} );
Dreamy_Jazz subscribed.

Per discussions with Kosta of Phab, I'll be taking this task on

Change #1204076 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/WikimediaEvents@master] hCaptcha instrumentation: Handle hcaptcha.render events during edits

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

Change #1204078 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] ext.confirmEdit.hCaptcha: Consider action=submit an edit interface

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

Change #1204078 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] ext.confirmEdit.hCaptcha: Consider action=submit an edit interface

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

Change #1204088 had a related patch set uploaded (by Kosta Harlan; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] ext.confirmEdit.hCaptcha: Consider action=submit an edit interface

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

Change #1204076 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] hCaptcha instrumentation: Handle hcaptcha.render events during edits

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

Change #1204238 had a related patch set uploaded (by Kosta Harlan; author: Dreamy Jazz):

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha instrumentation: Handle hcaptcha.render events during edits

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

Change #1204238 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha instrumentation: Handle hcaptcha.render events during edits

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T08:49:09Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204238|hCaptcha instrumentation: Handle hcaptcha.render events during edits (T409701 T409703 T409415)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T08:51:23Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204238|hCaptcha instrumentation: Handle hcaptcha.render events during edits (T409701 T409703 T409415)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-12T08:58:27Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204238|hCaptcha instrumentation: Handle hcaptcha.render events during edits (T409701 T409703 T409415)]] (duration: 09m 17s)

Change #1204088 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] ext.confirmEdit.hCaptcha: Consider action=submit an edit interface

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:13:28Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:15:49Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:22:49Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]] (duration: 09m 21s)

Change #1204359 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/WikimediaEvents@master] hCaptcha instrumentation: Log editor_interface for editAttempStep

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

Change #1204359 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] hCaptcha instrumentation: Log editor_interface for editAttempStep

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

Change #1204367 had a related patch set uploaded (by Kosta Harlan; author: Dreamy Jazz):

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha instrumentation: Log editor_interface for editAttempStep

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

Change #1204367 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha instrumentation: Log editor_interface for editAttempStep

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:01:28Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:27:19Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:48:36Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]] (duration: 47m 08s)