Form fails to submit on iPhone when web page is not on screen for too long

Created on 13 May 2023, over 1 year ago

Problem/Motivation

This bug report is a follow-up to https://www.drupal.org/project/recaptcha_v3/issues/3145790
This change fetches the token every 90 seconds using JavaScript. However, modern mobile browsers suspend the page when it’s not on screen, causing the token to not fetch in time.

Steps to reproduce

  • Open Safari on an iPhone
  • Go to a form with reCAPTCHA v3 enabled
  • Switch to a different page/app or lock the device for a few minutes
  • Switch back to the form and submit
  • There’s a chance that the submission will fail and a CAPTCHA error will display

Note that I can’t seem to reproduce this bug reliably as it’s not well-known to the public how iOS suspends web pages.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada andrew.wang

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024