Page MenuHomePhabricator

Cannot publish DiscussionTools reply on Android App
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

I have not been able to successfully publish a reply with DiscussionTools on the Android App.

Response from the request to https://test.wikipedia.org/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=discussiontoolsedit&paction=addtopic:

{
  "warnings": [
    {
      "code": "unrecognizedparams",
      "html": "Unrecognized parameter: matags.",
      "module": "main"
    }
  ],
  "discussiontoolsedit": {
    "result": "error",
    "edit": {
      "captcha": {
        "type": "hcaptcha",
        "mime": "application/javascript",
        "key": "5d0c670e-a5f4-4258-ad16-1f42792c9c62",
        "error": "missing-token"
      },
      "result": "Failure"
    }
  }
}

A similar thing might happen on iOS, but I don't have access to a test device to check this.

Environment

Platform: Samsung Galaxy S26, S25, S21, Pixel 10
Wiki(s): https://test.wikipedia.org MediaWiki 1.47.0-wmf.4 (rMWd947039b1cf7) 23:20, 1 June 2026.
App version: 50590 alpha 2026-06-01

Event Timeline

image.png (1,179×2,212 px, 234 KB)

It also does not work on the iOS app.

I'm guessing the app code does not actually use DiscussionTools code beyond just calling it's API?

Perhaps we can exempt the apps from hCaptcha code in DiscussionTools until they have a chance to update. For lack of a better approach, we could probably just detect the apps based on their user agent

I'm guessing the app code does not actually use DiscussionTools code beyond just calling it's API?

Perhaps we can exempt the apps from hCaptcha code in DiscussionTools until they have a chance to update. For lack of a better approach, we could probably just detect the apps based on their user agent

Yes, I think we need to do the UA detection approach and define an exemption in operations/mediawiki-config.

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

[operations/mediawiki-config@master] hCaptcha: Deduplicate edit API detection code

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

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

[operations/mediawiki-config@master] hCaptcha: Disable hCaptcha for DiscussionTools for the apps

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

Change #1296532 merged by jenkins-bot:

[operations/mediawiki-config@master] hCaptcha: Deduplicate edit API detection code

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

Change #1296533 merged by jenkins-bot:

[operations/mediawiki-config@master] hCaptcha: Disable hCaptcha for DiscussionTools for the apps

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

Mentioned in SAL (#wikimedia-operations) [2026-06-02T12:07:09Z] <dreamyjazz@deploy1003> Started scap sync-world: Backport for [[gerrit:1296532|hCaptcha: Deduplicate edit API detection code (T427887)]], [[gerrit:1296533|hCaptcha: Disable hCaptcha for DiscussionTools for the apps (T427887)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-02T12:09:00Z] <dreamyjazz@deploy1003> dreamyjazz: Backport for [[gerrit:1296532|hCaptcha: Deduplicate edit API detection code (T427887)]], [[gerrit:1296533|hCaptcha: Disable hCaptcha for DiscussionTools for the apps (T427887)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-02T12:16:11Z] <dreamyjazz@deploy1003> Finished scap sync-world: Backport for [[gerrit:1296532|hCaptcha: Deduplicate edit API detection code (T427887)]], [[gerrit:1296533|hCaptcha: Disable hCaptcha for DiscussionTools for the apps (T427887)]] (duration: 09m 02s)

I tested this using the Wikipedia Android App. Moving to QA for that to be double checked

A separate ticket is probably needed for enabling support in the apps?

I tested this using the Wikipedia Android App. Moving to QA for that to be double checked

A separate ticket is probably needed for enabling support in the apps?

Follow up task is T427936: Mobile apps: Support hCaptcha in DiscussionTools API edits

Kosta tested on iOS and I tested on Android, so this should be fine to resolve