Page MenuHomePhabricator

hCaptcha: Generate VisualEditorFeatureUse event when hCaptcha execute is invoked
Closed, ResolvedPublic

Description

Summary

To facilitate analysis around edits and hCaptcha usage, let's create an event in VisualEditorFeatureUse when hcaptcha.execute() is invoked.

Acceptance criteria

  • An event is logged to VisualEditorFeatureUse when hcaptcha.execute() is invoked for an edit, which can be connected to other events with the editing session ID

Event Timeline

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

[mediawiki/extensions/WikimediaEvents@master] hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse

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

Change #1205183 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse

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

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

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse

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

Change #1205558 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse

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

Mentioned in SAL (#wikimedia-operations) [2025-11-17T08:11:15Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1205558|hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse (T410146)]], [[gerrit:1205224|hCaptcha: Track the interfaceName in open-callback events (T410008 T402767)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-17T08:36:09Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1205558|hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse (T410146)]], [[gerrit:1205224|hCaptcha: Track the interfaceName in open-callback events (T410008 T402767)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-17T08:53:15Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1205558|hCaptcha: Record hcaptcha.execute() calls in VisualEditorFeatureUse (T410146)]], [[gerrit:1205224|hCaptcha: Track the interfaceName in open-callback events (T410008 T402767)]] (duration: 42m 00s)

dom_walden subscribed.

Publishing an edit in the WikiEditor on testwiki, when I see an hCaptcha challenge, I see two requests to https://intake-analytics.wikimedia.org:

{
  "event": {
    "user_id": 71434,
    "user_is_temp": true,
    "user_editcount": 2,
    "wiki": "testwiki",
    "skin": "vector-2022",
    "is_bot": false,
    "feature": "hcaptcha",
    "action": "execute",
    "editor_interface": "wikitext",
    "integration": "page",
    "platform": "desktop",
    "editingSessionId": "781b558ba9fb797a08c1632fe335e62b",
    "is_oversample": false
  },
  "schema": "VisualEditorFeatureUse",
  "webHost": "test.wikipedia.org",
  "wiki": "testwiki",
  "$schema": "/analytics/legacy/visualeditorfeatureuse/1.1.0",
  "client_dt": "2025-11-18T08:41:36.088Z",
  "meta": {
    "stream": "eventlogging_VisualEditorFeatureUse",
    "domain": "test.wikipedia.org"
  }
}
{
  "event": {
    "user_id": 71434,
    "user_is_temp": true,
    "user_editcount": 2,
    "wiki": "testwiki",
    "skin": "vector-2022",
    "is_bot": false,
    "feature": "hcaptcha",
    "action": "open",
    "editor_interface": "wikitext",
    "integration": "page",
    "platform": "desktop",
    "editingSessionId": "781b558ba9fb797a08c1632fe335e62b",
    "is_oversample": false
  },
  "schema": "VisualEditorFeatureUse",
  "webHost": "test.wikipedia.org",
  "wiki": "testwiki",
  "$schema": "/analytics/legacy/visualeditorfeatureuse/1.1.0",
  "client_dt": "2025-11-18T08:41:39.579Z",
  "meta": {
    "stream": "eventlogging_VisualEditorFeatureUse",
    "domain": "test.wikipedia.org"
  }
}

When I don't see the challenge, I only see the first request.