I followed these two resources and setup history tracking in SwiftData.
SwiftData History tracking:
Track model changes with SwiftData history
For data deduplication: Sharing Core Data objects between iCloud users
In the sample app (CoreDataCloudKitShare), a uuid: UUID field is used for deduplication logic. It sorts the entities by their uuids, reserves the first one, and marks the others as deduplicated.
Would it be a viable solution to use a createdAt: Date field for the sort operation instead of a uuid field, or are dates inherently problematic?