Skip to content

Fix/resend errors#188

Open
matiasqueroceballos wants to merge 8 commits intotrunkfrom
fix/resend-errors
Open

Fix/resend errors#188
matiasqueroceballos wants to merge 8 commits intotrunkfrom
fix/resend-errors

Conversation

@matiasqueroceballos
Copy link
Copy Markdown

Description

Implements cascading automatic retry logic for failed CRM form submissions using WordPress Action Scheduler. When a submission fails, the system automatically schedules up to 3 retry attempts, each scheduled 1 hour apart.

Changes

  • Modified retry_failed_entry() to properly handle cascading retries
  • Fixed response status check to match actual CRM API responses (status: 'ok')
  • Pass log ID to create_entry() for proper tracking
  • Register formscrm_retry_failed_entry hook globally (outside admin context) so Action Scheduler can execute it
  • Removed attempt limit from manual resend button (unlimited manual retries allowed)
  • Manual resend button no longer increments automatic retry counter
  • Fixed UI NaN issue by reloading page after successful manual resend

How It Works

  1. Form submission fails → log created, first retry scheduled for 1 hour
  2. First retry executes and fails → second retry automatically scheduled
  3. Second retry executes and fails → third retry automatically scheduled
  4. Third retry executes and fails → no more automatic retries
  5. Manual resend button available unlimited times regardless of automatic attempt count

Testing

  • Verified cascading retries create Action Scheduler actions in sequence
  • Confirmed each retry increments attempt counter (1/3, 2/3, 3/3)
  • Tested manual resend button works after max automatic attempts reached
  • Verified debug logging captures all retry lifecycle events

Related Issue

Closes #187

@matiasqueroceballos matiasqueroceballos self-assigned this Apr 29, 2026
@matiasqueroceballos matiasqueroceballos linked an issue Apr 29, 2026 that may be closed by this pull request
7 tasks
@matiasqueroceballos
Copy link
Copy Markdown
Author

@davidperezgar ya está corregio el debug message, quitado de la parte que había subido de logs

Comment thread includes/admin/class-error-log.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic Retry Logic for Failed CRM Submissions

3 participants