Skip to content

feat(data-events): add ActionScheduler logging and retry reason#4488

Open
miguelpeixe wants to merge 6 commits intofeat/data-events-sync-queuefrom
feat/data-events-sync-logging
Open

feat(data-events): add ActionScheduler logging and retry reason#4488
miguelpeixe wants to merge 6 commits intofeat/data-events-sync-queuefrom
feat/data-events-sync-logging

Conversation

@miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Feb 13, 2026

All Submissions:

Changes proposed in this Pull Request:

NPPD-1238

Depends on Automattic/newspack-newsletters#2031.

Implements AS logging and a reason property to retry actions for data events and syncs.

The sync method will return multiple errors, so the logged string will be the joined error messages rather than the usual ->get_error_message(), which returns the first error message from the object.

Automattic/newspack-newsletters#2031 is required because the upsert errors were no longer exposed in favor of a reader-friendly message. The proposed change is to compose a new WP_Error object with all the errors, with the generic reader-friendly message first so it's used in UIs.

How to test the changes in this Pull Request:

  1. Change your ESP settings to an invalid access token
  2. Register a new reader in a fresh session
  3. As an admin, navigate to ActionScheduler page: /wp-admin/admin.php?page=wc-status&tab=action-scheduler
  4. Search for newspack_contact_sync_retry
  5. Confirm that the latest entry contains reason in the args
  6. Wait for the first retry to run and confirm that, once completed, the logs are presented:
image

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@miguelpeixe miguelpeixe marked this pull request as ready for review February 13, 2026 18:38
@miguelpeixe miguelpeixe requested a review from a team as a code owner February 13, 2026 18:38
@miguelpeixe miguelpeixe self-assigned this Feb 13, 2026
@miguelpeixe miguelpeixe added the [Status] Needs Review The issue or pull request needs to be reviewed label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The issue or pull request needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant