Open heckj opened 6 months ago
I'm not sure if this would be right for the default file storage provider, but I've been playing with making NSDocument write to a bundle format using the general design suggested here for CloudKit .
The nice feature of this is that the format should then automatically merge. So for example you can share this on iCloud Drive and concurrent edits should converge.
Except my version seems to have bugs that I'm still figuring out :) Anyway, don't have anything fully working to share yet, just wanted to add this note for possible future implementation.
If you want to lift the logic, there's an implementation of the "partial incremental changes"/"compacted changes" in parallel in the DocumentStorage class of the repo - Following the JS impl, it was meant to ride about the provider, which is only concerned with shifting bytes onto, and off of, disk given various prefixes (used to determine locations)
Add a built-in storage provider that is initialized with a fileURL, to accomodate the following use cases:
.startAccessingSecurityScopedResource()
)