You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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