Adam S

Waterloo, Canada

speakman.net.nz

Age: 27

Android Developer from New Zealand, recently moved to Waterloo in Ontario.

You can find me on Twitter at @adamsnz or Google+.

2d
comment How to block existing async web requests?
I updated my answer with a way to get around the potential OOM issues (up to a point, of course). Yours gets around it altogether though.
2d
comment How to block existing async web requests?
I've updated this to include the id check in the observable chain filter(person -> person.getId() == -1) and a solution to the memory issue pointed out by @Marek which makes it overall much nicer.
2d
revised How to block existing async web requests?
added 733 characters in body
2d
answered How to block existing async web requests?
Mar
25
comment What is the current Crashlytics version?
You're not using the Fabric version of Crashlytics?
Mar
25
awarded Yearling
Mar
25
awarded Yearling
Mar
25
awarded Critic
Mar
23
awarded Critic
Mar
19
accepted How to handle RestKit nested array of ID references to objects that don't exist yet?
Mar
16
comment How to handle RestKit nested array of ID references to objects that don't exist yet?
...good grief I have the id mapping tested in a different test and it fails when I remove this fix too, not sure how I missed that one. Thanks a lot for your help Wain, and sorry for wasting your time on what turned out to not actually be an interesting problem after all.
Mar
16
comment How to handle RestKit nested array of ID references to objects that don't exist yet?
So, uh. Oops. It appears I wasn't ever mapping the id attribute of the permission group, which meant that there was never a matching object to create a relationship against! Turning on logging is what helped me track that down, though - thanks for that suggestion, and it really should've been my first port of call. Your understanding that the relations are created after the mappings appears to be correct; I don't need the additional descriptor for my mocked API response, and this works correctly in my mapping unit test too.
Mar
16
comment How to handle RestKit nested array of ID references to objects that don't exist yet?
[RKResponseDescriptor responseDescriptorWithMapping:[PermissionGroup mapping] method:RKRequestMethodGET pathPattern:@"projects/:serverId" keyPath:@"project.permission_groups" statusCodes:successCodes]
Mar
16
comment How to handle RestKit nested array of ID references to objects that don't exist yet?
So, the tests I was running are just mapping tests and don't use the descriptors (from what I can tell). That said, I've got some other tests which mock the API responses and I had a play with those and was seeing the same results. I tried this solution (adding a descriptor for the "project.permission_groups" keypath before the "project" one) and am unfortunately still seeing the same result - an empty set of relations.
Mar
16
revised How to handle RestKit nested array of ID references to objects that don't exist yet?
added 2 characters in body
Mar
16
comment How to handle RestKit nested array of ID references to objects that don't exist yet?
The JSON from the server will look like { "project": { ... } } (hence the keyPath="project" on the descriptor) where as the file I'm using for my unit test looks similar to what I posted above, without the top-level "project" key - since I'm just testing the project mapping. Your comment about the connection running at the end of the internal mapping - you mean it should map each key (name, collaborations, permission groups, etc) then create relationships? Does my test case perhaps run too early in the chain?
Mar
16
reviewed Leave Closed How to check integer overflow in C?
Mar
16
awarded Custodian
Mar
16
reviewed Close Regex check from a link
Mar
16
reviewed Close Unit Test Observable.StartAsync
1 2 3 4 5