LoopKit / Loop

An automated insulin delivery app for iOS, built on LoopKit
https://loopdocs.org
Other
1.52k stars 1.31k forks source link

Watch app crash #1287

Closed ps2 closed 4 years ago

ps2 commented 4 years ago

When testing https://github.com/LoopKit/LoopKit/pull/317, came across a crash on the watch app.

unrecognized selector sent to NSUUID.

Possible nil/NSNull UUID, related to watch updates to store glucose data from context refresh from Loop? Possible empty SQL 'IN' query?

Crash

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSConcreteUUID compare:]: unrecognized selector sent to instance 0x16e773c0'
terminating with uncaught exception of type NSException

Last Exception Backtrace:
(0x20ccf178 0x205dac68 0x20bd5c04 0x20cd310c 0x20cd50ac 0x21794c60 0x20c5e2c4 0x20c5e354 0x20c5de80 0x20c5e824 0x21795060 0x2169ac44 0x24803030 0x3e5561e4 0x1065220 0x110575c 0x106ea9c 0x110a490 0x106eabc 0x24914fc0 0x206a0fc0 0x206add00 0x206ad7f4 0x24801860 0x1100724 0x10ffb5c 0x106ea78 0x2069fc1c 0x206a0fc0 0x206a7128 0x206a7b08 0x206b101c 0x208db704 0x208e1808)

Logs

2020-03-17 16:49:36.8592 -0700    info 0x2e663 0x578ab WatchApp Extension[1774] (HealthKit): Stopping query <HKAnchoredObjectQuery 706A3C QoS=Default state=deactivated>
2020-03-17 16:49:36.8593 -0700 default 0x2e663 0x578ab WatchApp Extension[1774] (LoopKit): observeUpdates(to:error:): new: 0 deleted: 0 anchor: Optional(<HKQueryAnchor: 0x16e92110 1280050>) error: nil
2020-03-17 16:49:36.8597 -0700 default 0x2e1a6 0x0 WatchApp Extension[1774] (WatchConnectivity): NSDictionary<NSString *,id> *WCDeserializePayloadData(NSData *__strong, NSError *__autoreleasing *) success: YES
2020-03-17 16:49:36.8609 -0700   error 0x2e65d 0x0 WatchApp Extension[1774] (WatchApp Extension): sendGlucoseBackfillRequestMessage error: Error Domain=WCErrorDomain Code=7012 "Message reply took too long." UserInfo={NSLocalizedFailureReason=Reply timeout occurred., NSLocalizedDescription=Message reply took too long.}
2020-03-17 16:49:36.8610 -0700 default 0x2e65d 0x0 WatchApp Extension[1774] (WatchConnectivity): -[WCSession storeReceivedAppContext:withAppContextData:]
2020-03-17 16:49:36.8611 -0700 default 0x2e65d 0x0 WatchApp Extension[1774] (WatchApp Extension): didReceiveApplicationContext
2020-03-17 16:49:36.8664 -0700 default 0x2e18c 0x0 WatchApp Extension[1774] (HealthKit): Saving 1 objects
2020-03-17 16:49:36.8751 -0700 default 0x2e1a6 0x0 WatchApp Extension[1774] (Foundation): Read options: 1 -- URL: Library/Application%20Support/com.apple.watchconnectivity/5EC761C7-824C-49AB-A428-5A0C52251379/UserInfoTransfers/contents.index -- file:///var/mobile/Containers/Data/PluginKitPlugin/0C76E489-D462-42DE-A11A-B24FB460F68F/ -- purposeID: C4C91F0E-42B0-4182-BCDE-68C11B4DA9C6 -- claimID: 687C4ACC-BC0B-45D1-B44A-DA2B06FB4B61
2020-03-17 16:49:36.8788 -0700 default 0x2e663 0x56bd9 WatchApp Extension[1774] (WatchConnectivity): -[WCQueueManager onqueue_handleAcceptanceWithCurrentAccepted:nextAvailable:] current YES, next YES
2020-03-17 16:49:36.8800 -0700 default 0x2ef49 0x0 WatchApp Extension[1774] (Foundation): Claim 687C4ACC-BC0B-45D1-B44A-DA2B06FB4B61 granted in client
2020-03-17 16:49:36.8800 -0700 default 0x2ef49 0x0 WatchApp Extension[1774] (Foundation): Claim 687C4ACC-BC0B-45D1-B44A-DA2B06FB4B61 invoked in client
2020-03-17 16:49:36.8813 -0700 default 0x2e19d 0x572f8 WatchApp Extension[1774] (CoreFoundation): -[__NSConcreteUUID compare:]: unrecognized selector sent to instance 0x16e773c0
2020-03-17 16:49:36.9333 -0700 default 0x2e19d 0x572f8 WatchApp Extension[1774] (CoreFoundation): *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSConcreteUUID compare:]: unrecognized selector sent to instance 0x16e773c0'...
2020-03-17 16:49:36.9468 -0700 default 0x009d7 0x0 hangtracerd[171] (hangtracerd): Client disconnected: 1774
ps2 commented 4 years ago

Fixed in https://github.com/LoopKit/LoopKit/pull/317/commits/e8967be2ba43296a1df165794be0a71c73eb81a3