Disable submit button while an invisible reCAPTCHA check runs - #3343
vivi-the-going-merry[bot] wants to merge 1 commit into
Conversation
submitFormManual() only called showLoadingIndicator() on the invisible reCAPTCHA path, so disableSubmitButton() (only reached via showSubmitLoading()) never ran and the button stayed clickable for the whole duration of the check, allowing duplicate submissions. Switches that branch to showSubmitLoading() like the non-captcha path, and adds a 10s fallback that re-enables the button only if the reCAPTCHA check itself never resolved - the widget has no error/expired callback wired up, so a stalled check would otherwise leave the button disabled with no way to retry. Fixes Strategy11/formidable-pro#3368 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Sep 16, 2026 6:43p.m. | Review ↗ | |
| JavaScript | Sep 16, 2026 6:43p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3343 +/- ##
============================================
+ Coverage 28.36% 28.51% +0.14%
- Complexity 9806 9844 +38
============================================
Files 160 160
Lines 32921 33022 +101
============================================
+ Hits 9339 9416 +77
- Misses 23582 23606 +24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What was broken
submitFormManual()only calledshowLoadingIndicator()on the invisible-reCAPTCHA path, sodisableSubmitButton()(only reached viashowSubmitLoading()) never ran. The submit button stayed clickable for the whole duration of the invisible reCAPTCHA check, allowing duplicate submissions.What changed
showSubmitLoading(), same as the non-captcha path, disabling the button while the check runs.reenableSubmitIfRecaptchaStalls) that re-enables the button only if the check itself never resolved (hasInvisibleRecaptcha(object)still true) — the widget has noerror-callback/expired-callbackwired up, so a stalled or blocked check would otherwise leave the button disabled with no way to retry. Guarded so a real in-flight submission (recaptcha already resolved) is never touched.How it was verified
No existing JS unit-test harness or Cypress coverage exists for this frontend module (no jest/mocha in
package.json, norecaptchaspec intests/cypress). Verified live instead with a minimal jQuery +formidable.jsharness driven viaplaywright-cli, stubbinggrecaptchato control the invisible-recaptcha flow directly (no live Google dependency):submiton a form with an invisible-recaptcha field left the submit button enabled.Self-reviewed (reuse/simplification/efficiency/altitude/security lenses) before opening.
Closes #3368
🤖 Generated with Claude Code