Repository navigation
A bit earlier than expected, here’s Vein 1.2!
New Features
Relationship integrity check
The “big” new feature this release are the checkRelationshipIntegrity functions on ManagedObjectContext.
They check all relationships for their plausibility: stale references, out of sync states and data corruption. It gives you one Swift type containing all mismatches, locally and in the reverse table.
Usecases of this function and a future more thorough check function include:
- running in CI to check integrity after migrations
- running it in an app via a button or error trigger to help triage bugs
This function will become a lot more important once sync exists, but even today it may be a useful diagnostic tool.
Sideeffects
Macro generation changed slightly, now including .many or .one on the FieldInformation of relationships.
Fixed bugs
Many to none relationship (without inverse) didn’t insert new values
I ran the insert after a guard checking for inverses. Just moving it in front fixed it. Regression tests were added. The bug was discovered while writing tests for the integrity check function.
Should you find that you’re affected (reading an affected relationship property should log about a potential data corruption) you can either for every model of that type fetch the relationships and set them again, removing the references to uninserted (therefore unpersisted) models or use the new integrity check function to pinpoint exactly which models are affected and do the same specifically on them. depending on the amount of models using integrity check may be faster and consume less memory.
Other changes
- Release CI was fixed by making the expectations of 2 tests hardcoded instead of interpolating the swift type
- Added tests for integrity check function
- moved multithreaded stress tests to a separate target and XCTest to ensure they run one at a time with no other test concurrently occupying threads to guarantee there are always enough threads available
- added macro expansion test for relationship with inverse
- added AI usage disclosure and updated contributing.md to disallow AI generated contributions. This change was made to comply with nlnet’s policy.
What's Changed
- Fix release CI by making 4 strings hardcoded lol by @MiaKoring in #160
- Adds relationship integrity check function by @MiaKoring in #163
- added AI usage disclosure and updated CONTRIBUTING.md by @MiaKoring in #165
- Improve integrity check and fix #166 by @MiaKoring in #167
- Added more Tests by @MiaKoring in #168
- Move multithreaded tests to separate target and XCTest to make sure nothing is running in parallel by @MiaKoring in #169
Full Changelog: 1.1.2...1.2.0