Start a new topic

Offline queue generating empty PUT request

I'm using KinveyKit 1.26.0 and noticed that coming out of offline mode, my collection filled with empty entities (only _id, _kmd,_acl).



Apparently, when the queue is sent, for every valid PUT request, I get one with content-length=0. I've check com.kinvey.offlie_cache.sqlite3 and found only valid requests in savequeue.



Here are some requests:

valid: 4475bac905b14dd5bd06af427a8f2354

invalid: 543bc26835504b4eb3c757f0fd7c2dea

valid: 8d67347e7f9c4184aec81654022d2cce

invalid: b3295ed18bb6434881677bc7d3e0fdc5



Any idea?

I am currently investigating this issue, but have been unable to reproduce. For the entities in the sqlite db, for the save queue table; would you be able to share the data with me? Also, how are is the store and offline delegate constructed?
My store is made of entities with values of strings and numbers. No relational Data, no object. I use dummy offline delegates that echo the objectId to the console and return YES when they should (Save, Enqueue, Delete).

Also, this problem only happens on a real device. Everything is working fine on the simulator, but strangely, offline delegates do not seem triggered at all. Saving on entity to the collection while offline and then going online, on the simulator, I get:



2014-02-07 00:04:48:858 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:217 [INFO (NETWORK)] PUT https://baas.kinvey.com/appdata/kid_TVuOAg5xrf/SPCard/52f469174971b80c3902a0b7 [KinveyKit id: '5589ABB3-AE98-4138-8573-C49E8A8439BE']

2014-02-07 00:04:49:199 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSNSURLSessionOperation.m:121 [INFO (NETWORK)] received response: 200 {

Connection = "keep-alive";

"Content-Length" = 831;

"Content-Type" = "application/json; charset=utf-8";

Date = "Fri, 07 Feb 2014 05:04:48 GMT";

Server = nginx;

"x-kinvey-api-version" = 3;

"x-kinvey-executed-collection-hooks" = "Pre-Save";

"x-kinvey-request-id" = f46a410c6e7a4dc7974b2740484e2cfd;

"x-powered-by" = Express;

} (KinveyKit ID 5589ABB3-AE98-4138-8573-C49E8A8439BE)

2014-02-07 00:04:49:199 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:325 [INFO (NETWORK)] Kinvey Success (200) [KinveyKit id: '5589ABB3-AE98-4138-8573-C49E8A8439BE'] {

Connection = "keep-alive";

"Content-Length" = 831;

"Content-Type" = "application/json; charset=utf-8";

Date = "Fri, 07 Feb 2014 05:04:48 GMT";

Server = nginx;

"x-kinvey-api-version" = 3;

"x-kinvey-executed-collection-hooks" = "Pre-Save";

"x-kinvey-request-id" = f46a410c6e7a4dc7974b2740484e2cfd;

"x-powered-by" = Express;

}



while doing the same on the iPad, leads to an new entry in the sqlite db:



INSERT INTO savequeue VALUES('appdata_SPCard52f460cb279fd3ba2503f023','52f460cb279fd3ba2503f023','appdata_SPCard','PUT','{"X-Kinvey-Client-Method":"KCSCachedStore saveMainEntity:progress:withCompletionBlock:withProgressBlock:"}',1391468908.93135,'{"sO":1,"sg":1,"lRD":0,"rAC":0,"sID":"a","mP":1,"tCAT":0,"mO":1,"d":0.20000000298023224,"_id":"52f460cb279fd3ba2503f023","m":"FFFF","sM":"T01","aT":1,"cID":"FFFF-T01-013-01-EN-000-000","cQ":"1x13","dO":3,"gP":"000","cA":"13","e":"013","cM":5,"lAIT":"ISODate(\"2014-02-03T23:08:19.589Z\")","rDD":"ISODate(\"2044-11-14T16:45:06.997Z\")","se":0.20000000298023224,"sCAT":0,"rTAT":0,"l":"EN","tST":1,"fCATimes":0,"lAIC":4}');



and this log:



2014-02-06 23:39:22.332 SuperPrep[10600:4207] KinveyUser.m:372 [DEBUG] Current user found, using sessionauth (1@1) => XXXXXXXXX

2014-02-06 23:39:22:336 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:217 [INFO (NETWORK)] PUT https://baas.kinvey.com/appdata/kid_TVuOAg5xrf/SPCard/52f460cb279fd3ba2503f023 [KinveyKit id: '69DC519E-FC6A-4A02-AE88-CD16BE4872EE']

2014-02-06 23:39:22:362 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:319 [INFO (NETWORK)] Network Client Error Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x19270ff0 {NSErrorFailingURLStringKey=https://baas.kinvey.com/appdata/kid_TVuOAg5xrf/SPCard/52f460cb279fd3ba2503f023, NSErrorFailingURLKey=https://baas.kinvey.com/appdata/kid_TVuOAg5xrf/SPCard/52f460cb279fd3ba2503f023, NSLocalizedDescription=The Internet connection appears to be offline., NSUnderlyingError=0x19270480 "The Internet connection appears to be offline."} [KinveyKit id: '69DC519E-FC6A-4A02-AE88-CD16BE4872EE']

2014-02-06 23:39:22:372 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSEntityPersistence.m:399 [DEBUG (DATA)] Insert/update offline/52f460cb279fd3ba2503f023

2014-02-06 23:39:27.414 SuperPrep[10600:60b] KinveyUser.m:372 [DEBUG] Current user found, using sessionauth (1@1) => XXXXXXXXX

2014-02-06 23:39:27:417 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:217 [INFO (NETWORK)] PUT https://baas.kinvey.com/appdata/kid_TVuOAg5xrf/SPCard/52f460cb279fd3ba2503f023 [KinveyKit id: '05F7300F-C431-4F8E-B41D-F5846AD51559']

2014-02-06 23:39:27:890 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSNSURLSessionOperation.m:121 [INFO (NETWORK)] received response: 200 {

Connection = "keep-alive";

"Content-Length" = 13;

"Content-Type" = "application/json; charset=utf-8";

Date = "Fri, 07 Feb 2014 04:39:17 GMT";

Server = nginx;

"x-kinvey-api-version" = 3;

"x-kinvey-executed-collection-hooks" = "Pre-Save";

"x-kinvey-request-id" = 87aaf82bd8494022b0301ac7d2d1802d;

"x-powered-by" = Express;

} (KinveyKit ID 05F7300F-C431-4F8E-B41D-F5846AD51559)

2014-02-06 23:39:27:893 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:325 [INFO (NETWORK)] Kinvey Success (200) [KinveyKit id: '05F7300F-C431-4F8E-B41D-F5846AD51559'] {

Connection = "keep-alive";

"Content-Length" = 13;

"Content-Type" = "application/json; charset=utf-8";

Date = "Fri, 07 Feb 2014 04:39:17 GMT";

Server = nginx;

"x-kinvey-api-version" = 3;

"x-kinvey-executed-collection-hooks" = "Pre-Save";

"x-kinvey-request-id" = 87aaf82bd8494022b0301ac7d2d1802d;

"x-powered-by" = Express;

}

2014-02-06 23:39:27:900 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSEntityPersistence.m:344 [DEBUG (FILESYSTEM)] Deleting obj 52f460cb279fd3ba2503f023 from unsaved queue

2014-02-06 23:39:27:913 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSObjectCache.m:308 [ERROR (DATA)] No id provided for entity: {

}, collection: SPCard

Hmm. Check out KinveyKit 1.26.1 http://devcenter.kinvey.com/ios/downloads; this should be fixed now
Login or Signup to post a comment