Repository navigation
Conversation
push_profile_to_workos() ignored the update_user() result and stamped _workos_last_synced_at either way, so a rejected change (e.g. an email WorkOS answers with email_not_available) left WordPress and WorkOS apart with no trace. On error the push now leaves the sync time alone, stores the code, message, fields and time in _workos_sync_error, writes a debug log line and a profile_push_failed activity-log entry, and fires workos_profile_push_failed. The next successful push (or an unlink) clears it, and the WorkOS panel on the user-edit screen shows it. Closes #57
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.
When a profile push to WorkOS failed, nobody found out.
push_profile_to_workos()ignored theupdate_user()result and stamped_workos_last_synced_ateither way. The common case is an email change to an address another WorkOS user already holds: WorkOS answersemail_not_available, WordPress keeps the new email and WorkOS keeps the old one.Stacked on #75 (
fix/profile-name-push).Changes
update_user()result._workos_last_synced_atalone and stores the error on the user in_workos_sync_error(UserSync::META_SYNC_ERROR): the WorkOS code (or theWP_Errorcode for transport errors), message, fields and time.profile_push_failedActivity Log entry, and firesworkos_profile_push_failed( $user_id, $workos_id, $update, WP_Error $error ).profile_push_failedis in the Activity Log type filter.uninstall.phpremoves the new meta key.docs/profile-sync.mdandAGENTS.mddescribe the hook and the meta.Verified
UserSyncProfilePushTestgains 7 tests: success stamps the sync time,email_not_available(meta, action arguments, Activity Log entry, sync time unchanged), a transport error, clearing on the next success, clearing on unlink, and the profile notice with and without an error. Six of them fail on the base branch.main, plus the 15constantstests.Closes #57