firely-net-sdk icon indicating copy to clipboard operation
firely-net-sdk copied to clipboard

SnapshotGenerator: Keep snapshot when differential is missing

Open mharthoorn opened this issue 1 year ago • 6 comments

Problem: If the snapshot generator encounters a StructureDefinition (of type LogicalModel) that already has a snapshot, but not a differential, it will remove that snapshot without replacing it (only when SnapshotGeneratorSettings.ForceRegenerateSnapshots is set to true)

Solution The SnapshotGenerator should not remove a snapshot when there is no differential present in a StructureDefinition.

Alternatives

  • Create an extra setting SnapshotGeneratorSettings.SkipRegenerateOnMissingDifferential
  • Throw an Exception
  • Add a warning to the OperationOutcome

Additional context In bulk snapshot operations this situation tends to go unnoticed and leads to loss of data / correctness in publications.

mharthoorn avatar Sep 12 '23 07:09 mharthoorn