Open
Description
Describe the bug
We got a crash report in Crashlytics today stating the following:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=640 "You can’t save the file “StoredModels.sqlite” because the volume “Data” is out of space." UserInfo={NSLocalizedFailureReason=Excluding SQLite file from backup caused an error, NSFilePath=/var/mobile/Containers/Data/Application/B50CAAAE-B135-4EB1-8725-854C1ABA24E1/Documents/StoredModels.sqlite, NSUnderlyingError=0x280235260 {Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device"}, NSURL=file:///var/mobile/Containers/Data/Application/B50CAAAE-B135-4EB1-8725-854C1ABA24E1/Documents/StoredModels.sqlite}: file Sync/DataStack.swift, line 66
This is occurring on a telephone that doesn't have enough space to create a new DataStack and we have no initializers for DataStack that throws an error since there are a lot of explicitly unwrapped code like this:
extension NSManagedObjectModel {
convenience init(bundle: Bundle, name: String) {
if let momdModelURL = bundle.url(forResource: name, withExtension: "momd") {
self.init(contentsOf: momdModelURL)!
} else if let momModelURL = bundle.url(forResource: name, withExtension: "mom") {
self.init(contentsOf: momModelURL)!
} else {
self.init()
}
}
}
To Reproduce
Steps to reproduce the behavior:
- Get a phone that is almost running out of space
- Create a new datastack on it
Expected behavior
The app shouldn't crash
iOS Version (please complete the following information):
14.2.0
Framework Version (please complete the following information):
- Sync 6.0.0
Metadata
Metadata
Assignees
Labels
No labels
Activity