Repository navigation
3.0.2
What's Changed
Fixed
ModelState.deleteAll()no longer fails silently on a model that has a relationship. In 3.0.1 SwiftData rejected the batch delete, the lenientdeleteAll()logged and swallowed the error, and the rows stayed.deleteAll()now fetches the matching models and deletes each one, so cascade and nullify rules run.ModelState.deleteAll()ignores the descriptor'sfetchLimitandfetchOffset, as it did in 3.0.1. It deletes every model matching the descriptor's predicate, and the nextmodelsread is empty.modelsstill honors the limit and offset.- A write through a
DependencySliceof a struct now sticks. The change is stored on the dependency inApplication, whether the write goes through@DependencySliceorApplication.dependencySlice. AnApplication.DependencySlicehandle created earlier reads and writes the current dependency, so it keeps sibling fields and edits anoverrideinstalled after the handle was created. - Concurrent
Keychainget,set, andremoveof the same key no longer deadlock. All three take one shared lock, including acrossKeychaininstances. - A
nilwrite through anOptionalSlicestoresnilwhen the field is optional. When the field is not optional, the write is ignored and nothing is notified.
Known issues
- The other documentation languages still describe
deleteAll()as deleting every model matching the wholeFetchDescriptor. The English page says the predicate, and thatfetchLimitandfetchOffsetare ignored.
Full Changelog: 3.0.1...3.0.2