Fix Arkose challenge submit timing race condition during signup
What does this MR do and why?
Fix Arkose challenge submit timing race condition during signup
When users completed the Arkose challenge and clicked Continue before the SDK callback fired, they saw a misleading verification error. Now the form submission is deferred briefly, showing a spinner on the button, auto-submitting once the token arrives or showing the error after a 2s timeout.
One caveat: When the challenge was not done or done incorrectly and the user clicks Continue, then it takes 2s to show the error message. However, I think it's more important that the happy path works seamlessly.
This change is gated behind the feature flag: arkose_labs_signup_challenge_loading_state
Rollout-issue: Roll out: feature-flag: arkose_labs_signup_chal... (#604110)
References
9d in Growth Team Brainstorm: Problems and Opportunities for FY27 H2
Closes Double continue required on registration due to... (#591805)
Screenshots or screen recordings
| Context | Before | After |
|---|---|---|
| Normal registration | ||
| Trial registration | ||
| Submit without arkose |
How to set up and validate locally
Setup Arkose locally
- Enable Arkose via rails console
ApplicationSetting.current.update(arkose_labs_enabled: true) - Enable
Feature.flag(:arkose_labs_signup_challenge_loading_state) - Set Arkose API keys in rails console (keys in 1Password under
ArkoseLabs API keys, take theGITLAB - DEVELOPMENT - REGISTRATION FLOW - KEY 1not production:
ApplicationSetting.current.update(
arkose_labs_public_api_key: '<dev_public_key>',
arkose_labs_private_api_key: '<dev_private_key>',
arkose_labs_namespace: 'client'
)- Visit
https://gdk.test:3443/users/sign_up - Finish the challenge and click
Continueas soon as the Arkose iFrame shows success. - It should wait for a second and then submit
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.