Skip to content

Correct user membership patch outcomes and external-account transfer recovery #2672

Open

Description

@niemyjski

PR #2631 adds optimistic concurrency to user records, but its application recovery paths can report writes that did not happen or restore ownership after an ambiguous write failure.

Reproduced against the PR implementation with focused handler tests before changing production code:

  • Adding an organization user ignores PatchAsync returning false, mutates the previously loaded user, and sends success notifications.
  • A successful membership patch still leaves the loaded user's version and other fields stale; manually adding the organization ID does not produce a current snapshot.
  • A failed external-account destination save can restore the previous owner. A transport/cache failure does not prove the save was uncommitted, and reads of the source and destination do not coordinate a third claimant.

The regression run had 3 failures and 3 passes. Acceptance: check patch results before success side effects, use a fresh persisted user where later behavior needs it, and remove speculative external-account restoration. Verify the library's native version behavior with repository integration tests before retaining application overrides. Preserve revocation and original failure diagnostics.

Tracked fix: #2631. Cross-document external identity uniqueness requires a separate design; a query followed by a write does not enforce uniqueness atomically.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions