Skip to content

Rollback after failed operation #200

@joel-mason

Description

@joel-mason

According to the SCIM RFC, it mentions that if there are multiple operations, and one fails, all operations should be rolled back to the start state.

A PATCH request, regardless of the number of operations, SHALL be
treated as atomic.  If a single operation encounters an error
condition, the original SCIM resource MUST be restored, and a failure
status SHALL be returned.

And I noticed that this SCIM-SDK doesn't do that. Is this something you are aware of?
Below you can find the JSON Payload of the Patch Operation, which is trying to update the same emails.value attribute.
The first operation is fine, but the second operation fails due to a bad path, and then the third operation is not executed.
What I would expect to happen is when the second operation fails, the first one is rolled back.

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "path": "emails[value eq \"[email protected]\"].value",
      "op": "replace",
      "value": "[email protected]"
    },
    {
      "path": "email[value eq \"[email protected]\"].value",
      "op": "replace",
      "value": "[email protected]"
    },
    {
      "path": "emails[value eq \"[email protected]\"].value",
      "op": "replace",
      "value": "[email protected]"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions