Skip to content

Profile push to WorkOS ignores errors #57

Open

Description

@bordoni

When a profile push to WorkOS fails, nobody finds out. UserSync::push_profile_to_workos() ignores the result of update_user() and stamps _workos_last_synced_at either way.

The common case: an email change in WordPress to an address that another WorkOS user already holds. WorkOS answers email_not_available, WordPress keeps the new email, WorkOS keeps the old one, and the two drift apart with no log entry.

Fix

  • Check the update_user() result.
  • On error:
    • don't stamp _workos_last_synced_at;
    • store the error code and time on the user (e.g. _workos_sync_error) so the user screen can show it;
    • write an activity-log entry;
    • fire workos_profile_push_failed( $user_id, $workos_id, $update, WP_Error $error ).
  • Clear the stored error on the next successful push.
  • Show the stored error in the WorkOS panel on the user-edit screen.

Done when

  • A push that returns an error is logged, fires the action and leaves the user marked as out of sync.
  • A later successful push clears it.
  • Tests cover success, email_not_available and a transport error.

Activity

  1. added this to the 1.0.11 milestone on Oct 17, 2026
  2. modified the milestones: 1.0.11, 1.0.12 on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions