Summary
It seems that somehow a fresh hCaptcha response token is being considered by the siteverify API as already seen but only in reproducible situations. It seems there is some kind of race condition that causes the hCaptcha token to be verified twice
Background
- All such logs are at https://logstash.wikimedia.org/goto/388a342650ad79d8087bad1e0fd94390
- Some of these may be expected, which happens if a user makes more than one API request with the same hCaptcha token (as it can only be used once)
- However, not all of these are that and I have seen this happen when triggering the AbuseFilter consequence while using DiscussionTools to edit
- We should ensure that the siteverify API gets called once per request
- It seems that currently this does not happen and multiple calls to HCaptcha::passCaptcha will make multiple calls to that API