Skip to content

is_conflict is too narrow, so an import does not converge on replay #27

Description

@jorisvilardell

Describe the bug

is_conflict (libs/ferriskey-cli-core/src/import/apply.rs) recognises a conflict only from a 409, or a 400 whose body contains exist. The server answers 500 when a realm name is already taken (a raw realms_name_key unique violation), so re-running an import stops at its first line instead of converging — while the file header promises that "an import can be replayed to converge".

Expected behaviour

Replaying an import must converge. Two changes, either of which helps on its own:

  1. Widen is_conflict to recognise a unique-constraint violation surfaced as a 500 (the body names the constraint), so the CLI stays usable against servers already deployed.
  2. Have the server answer 409 — tracked in ferriskey/ferriskey.

Point 1 should not be dropped once point 2 ships: the CLI has to keep working against older servers.

A skipped conflict should be reported in ImportReport as "already present", so a converging run is distinguishable from one that did nothing.

Environment

ferris-ctl 0.2.3, FerrisKey server 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions