Page MenuHomePhabricator

VisualEditor hCaptcha: Closing the save dialog mid hcaptcha execution causes future save dialogs to not allow saving edits
Closed, ResolvedPublicBUG REPORT

Description

Summary

If a user is using the VisualEditor interface and a hCaptcha widget is being executed, then exiting the save dialog before the conclusion of the execution causes the promise returned by hcaptcha.execute to never resolve

Steps to reproduce

  1. Enable hCaptcha on your wiki and make it trigger for all edits
  2. Open the VisualEditor edit interface with an account that does not have the skipcaptcha right
  3. Make some changes and then open the save dialog
  4. Click "Save changes"
  5. Press the "Esc" key while the save dialog has it's loading animation set
  6. Reopen the save dialog

What happens?

The save dialog does not allow the user to proceed with their edit because the save dialog is still in the pending state:

image.png (720×450 px, 37 KB)

Acceptance criteria

  • Closing the dialog mid hcaptcha execution should still allow the user to reopen the save dialog and submit the edit

Event Timeline

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

[mediawiki/extensions/ConfirmEdit@master] VisualEditor hCaptcha: Reject execution promise if dialog closes

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

Change #1277644 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] VisualEditor hCaptcha: Reject execution promise if dialog closes

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

Testing notes

It would be great to retest this on testwiki, trying to find as many places/states where you can cancel the hCaptcha loading or dismiss the challenge (particularly using esc or similar). The below diagram may give you some inspiration. We want make sure that a user can always successfully publish an edit.

I have tested locally. I tried to find all the states (see below) in which hCaptcha can trigger, pressing escape and seeing if I can then successfully publish my edit.

mobile_hcaptcha_state_diagram.png (577×735 px, 32 KB)

On testwiki, I have experimented with closing the save dialog in various cases. I was always able to reopen the dialog and save successfully.

Thanks for the in-depth QA!