fix: form submission reliability — reCAPTCHA timing, error handling, logging (v1.0.5) - #378
Merged
Conversation
The silent SEND_ERROR branch (non-200 Airtable responses) logged nothing, and the prior success line fired for any completed request regardless of status. Log the real HTTP status and the Airtable response body so send failures are diagnosable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a 10s request timeout and log HTTP/JSON errors plus the full Google result (success, score, action, hostname, error-codes) on failed verification, so intermittent reCAPTCHA failures can be diagnosed from the log. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
reCAPTCHA v3 tokens expire ~2 minutes after generation, so minting the token once at page load caused failures for anyone slow to fill out the form. Generate a fresh token at submit time instead. Also add an AJAX error/timeout handler (30s) so failed submissions surface an error instead of hanging on 'Sending...'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document how to diagnose (403 INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND in debug.log) and fix an expired/revoked Airtable token by issuing a new PAT scoped to the BD4D-Relationships-Main XRM base. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several contact-form reliability issues surfaced while diagnosing "Unable to send message" / stuck-on-"Sending…" reports, and adds diagnostics so future failures are self-explanatory in the log.
Changes (one commit each)
class-bd4d.php): log the real HTTP status and the Airtable response body on send failure. The prior "success" line fired for any completed request regardless of status, and the non-200 failure branch logged nothing — making failures undiagnosable.class-google-recaptcha.php): add a 10s timeout and log HTTP/JSON errors plus the full Google result (success,score,action,error-codes) on failed verification.main.js+ built assets):README.md): add a "Rotating the Airtable Token" runbook (diagnose the 403INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND, issue a new PAT scoped to the base, verify).1.0.5.Root causes found during investigation
Test plan
debug.logshowsAirtable API responded HTTP 200.Deployment notes
main.min.jsetc.) are committed — no rebuild needed at deploy.main).🤖 Generated with Claude Code