Skip to content

Import conflict resolution: per-import policy with configurable defaults #64

Description

@DutchJaFO

Conflict types

Situation Definition Handling
Same stable ID (same quote + same source name) The incoming record is a revision of an existing one Governed by the conflict policy below
Same quote text, different source Two genuinely different records that happen to share text Both inserted; surfaced in the review UI (#65) for manual resolution

Same-text conflicts are not auto-resolved — they require human judgement and are out of scope for this issue.

Conflict policy (same stable ID)

Two options, selectable per import and as a global default:

Policy Behaviour
skip Keep the existing record. Incoming record is ignored.
newest-wins Overwrite the existing record with the incoming one. Allows source files to be updated with corrections.

Default: newest-wins — this is the policy that lets users ship fixes via updated source files.

Configuration

  • Global default stored in app settings: Quotinator__DefaultConflictPolicy (skip or newest-wins).
  • Overridable per import run via a query parameter on the import endpoint (Import endpoint: POST /api/v1/quotes/import #45): ?conflictPolicy=skip or ?conflictPolicy=newest-wins.
  • The startup seeder uses the global default. It does not accept per-run overrides.

ImportBatch recording

The ImportBatch row (#58) for each run records the policy that was active: ConflictPolicy TEXT NOT NULL. This ensures the behaviour of any past import is auditable.

Dependencies

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

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions