Closed cmckni3 closed 4 years ago
Ah, I see the lock/unlock methods have been deprecated. https://developer.apple.com/documentation/coredata/nspersistentstorecoordinator/1468775-lock?language=objc
I wonder if @wndxlori has any thoughts on this
Let me fix the build, then we can get this merged in.
For anyone else reading, here’s more details on the what and why of this https://stackoverflow.com/questions/34334264/lock-is-deprecated-first-deprecated-in-ios-8-0-use-performblockandwait-in
Sorry @wndxlori I didn't see your comment. I just finished fixing the build. So the part that is still failing should be fixed by this PR.
Exactly, I forgot to mention that in the commit message
Merged master into my branch. Can clean up the history if necessary
hmmm is performBlockAndWait
deprecated? I can't find anything about such but @amirrajan just informed me of it
@cmckni3 No, it's not deprecated. It's right here: https://developer.apple.com/documentation/coredata/nspersistentstorecoordinator/1468862-performblockandwait?language=objc
correct, I found it in the Objective-C documentation. Swift docs only mention perform
Sorry I spaced. Pneumonia will do that. The build fails for this PR, and I downloaded your repo clone, and tried to build this branch and it barfed for me too. Can you fix that, so we can get this merged and released @cmckni3?
@wndxlori are you referring to the spec errors?
This error happens on the specs on master for me:
- performs a limited fetchCoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/cmcknight/Library/Developer/CoreSimulator/Devices/5C1C25DC-6C75-4490-B549-49745455CC8E/data/Containers/Data/Application/A2998C22-83A8-40C1-95C4-637F09C81A55/Documents/CDQ.sqlite options:{
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
} ... returned error NSCocoaErrorDomain(512) with userInfo dictionary {
reason = "Failed to create file; code = 24";
}
That’s odd. I get no errors on master. And the Travis build for master is green too.
I’m building on Mojave, and using Ruby 2.6.3 to run the tests.
On Oct 17, 2019, at 4:05 PM, Chris McKnight notifications@github.com wrote:
@wndxlori https://github.com/wndxlori are you referring to the spec errors?
This error happens on the specs on master for me:
- performs a limited fetchCoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/cmcknight/Library/Developer/CoreSimulator/Devices/5C1C25DC-6C75-4490-B549-49745455CC8E/data/Containers/Data/Application/A2998C22-83A8-40C1-95C4-637F09C81A55/Documents/CDQ.sqlite options:{ NSInferMappingModelAutomaticallyOption = 1; NSMigratePersistentStoresAutomaticallyOption = 1; } ... returned error NSCocoaErrorDomain(512) with userInfo dictionary { reason = "Failed to create file; code = 24"; } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/infinitered/cdq/pull/141?email_source=notifications&email_token=AAAEFIHVTNFBFNBXUBW74BLQPDOUPA5CNFSM4IYXNR6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRVPCQ#issuecomment-543381386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFIF7MRJXAMLTGZAOG4LQPDOUPANCNFSM4IYXNR6A.
OSX: Mojave RM: 6.4 XCode: 11.1 Ruby: 2.5.6
I get this error sporadically on my branch:
2019-10-21 17:50:05.878 CDQ[31370:12472113] *** Terminating app due to uncaught exception
'TypeError', reason: 'motion/cdq/store.rb:97:in `block in create_icloud_store': exception object expected (TypeError)
EDIT I see the same error on Travis CI
Let me run on master a few times
Yeah there's something going on with specs on my branch. The app included doesn't use icloud storage so that doesn't help test.
Timestamp Update Case
- should not set created_atCoreData:
Bacon::Error: #<NSManagedObjectContext:0x600003b6a3e0>.==(nil) failed
spec/cdq/context_spec.rb:75:in `<main>': CDQ Context Manager - pops temporarily if passed a block
motion/cdq/context.rb:50:in `block in pop'
motion/cdq/context.rb:303:in `save_stack'
motion/cdq/context.rb:48:in `pop'
spec/cdq/context_spec.rb:74:in `<main>'
@cmckni3 Have you had any time to work on fixing the build for this PR?
Haven't had time to look at it.
Interesting but a bit unrelated: NSPersistentStoreUbiquitousContentNameKey
and NSPersistentStoreUbiquitousContentURLKey
have been deprecated for awhile.
🤷♂️ (╯°□°)╯︵ ┻━┻
So I pulled your branch, and this failure is weird. I can duplicate the error that Travis is showing... sometimes. And here's the thing that really bothers me... in the test that fails, it is failing in a method that shouldn't even have been called. Basically, current calls this:
def create_store
if invalid?
raise "No model found. Can't create a persistent store coordinator without it."
else
if @icloud
create_icloud_store
else
create_local_store
end
end
end
And for this test, invalid is SUPPOSED to be TRUE. Instead, it's running down into create_icloud_store
and dying (as it should, because there's no model).
Yeah it’s very flaky. I did some investigation yesterday and master sometimes fails too as seen in #149
Seriously tempting to just ditch the iCloud stuff completely at this point. https://stackoverflow.com/questions/47137659/alternate-to-nspersistentstoreubiquitouscontentnamekey-key-in-core-data-in-ios-1
I ran into the exception crashing because the wrong path and some database I/O errors yesterday.
Thinking it’s a race condition due to the async queue.
yeah ditching the iCloud piece is an option. It was deprecated in iOS 10 iirc from my digging yesterday.
I probably should have tried those keys out in a blank XCode project with CoreData.
Want to close in favor of #150?
Probably, yes. However, I think we have a deeper race condition that needs fixing there, too. In #150, the build works fine for iOS, and fails ~25% of the time for macOS. Grrr.
I noticed that. How annoying
use performBlockAndWait to create iCloud store