Closed rastersize closed 11 years ago
Probably also happens for [OPFQuestion all] but that took to long to run so I stopped the process.
There's ole weird shit going on. Specs that were succeeding are failing after I did the last merge from master. Will look into this tomorrow.
25 apr 2013 kl. 18:24 skrev Aron Cedercrantz notifications@github.com:
Probably also happens for [OPFQuestion all] but that took to long to run so I stopped the process.
— Reply to this email directly or view it on GitHub.
I made some change to the query interfaces, are you still able to replicate this error?
I had this interesting bug which made my controller go completely nuts. I wanted to NSLog the OPFPost which gets passed to my OPFCommentViewController. Whenever I did the stack went completely crazy logging recursive craziness I guess.
So doing:
NSLog(@"%@", self.postModel);
caused something like:
2013-04-29 10:55:15.921 Code Stream[1997:c07] Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]
2013-04-29 10:55:15.923 Code Stream[1997:c07] Executing SQL on db baseDB: SELECT 'posts'.* FROM 'posts' WHERE 'posts'.'id' = '8414113' LIMIT 1
2013-04-29 10:55:15.924 Code Stream[1997:c07] Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]
2013-04-29 10:55:15.926 Code Stream[1997:c07] Executing SQL on db baseDB: SELECT 'posts'.* FROM 'posts' WHERE ('posts'.'post_type_id' = '1' AND 'posts'.'id' = '8414076') LIMIT 1
2013-04-29 10:55:15.927 Code Stream[1997:c07] Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]
2013-04-29 10:55:15.931 Code Stream[1997:c07] Executing SQL on db baseDB: SELECT 'comments'.* FROM 'comments' WHERE 'comments'.'post_id' = '8414113'
2013-04-29 10:55:15.932 Code Stream[1997:c07] Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]
2013-04-29 10:55:15.945 Code Stream[1997:c07] Executing SQL on db baseDB: SELECT 'users'.* FROM 'users' WHERE 'users'.'id' = '614165' LIMIT 1
2013-04-29 10:55:15.946 Code Stream[1997:c07] Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]
I can only assume that a description call is recursively called but tbh I don't really now. I just don't log that model for now (。◕‿‿◕。).
Groet'n, Tobi
It kinda makes sense in a way. A post has many comments and a comment has a post. Description probably tries to print all properties. To print post.comments, it will fetch the comments from the db. To describe each comment, is has to get the connected post. So it fetches that. And OH! I need to describe this user too! Better get all its comments... And on and on and on and on... Hm. Gunna have to think hard on this.
Don't worry too much I'd say. It works cool as long as you don't log that beast.
On Monday, 29. April 2013 at 11:04, Jesper Josefsson wrote:
It kinda makes sense in a way. A post has many comments and a comment has a post. Description probably tries to print all properties. To print post.comments, it will fetch the comments from the db. To describe each comment, is has to get the connected post. So it fetches that. And OH! I need to describe this user too! Better get all its comments... And on and on and on and on... Hm. Gunna have to think hard on this.
— Reply to this email directly or view it on GitHub (https://github.com/opfo/app/issues/12#issuecomment-17156212).
“Easy fix”: Override the -description
method of all models and just print what we want (and don’t print any relation) :smiley_cat:
For example:
- (NSString *)description
{
return [NSString stringWithFormat@"<%@: %p> id = %@; name = %@;", self.class, self, self.identifier, self.name];
}
Oh i thought that thing was already overwritten.
On Monday, 29. April 2013 at 11:20, Aron Cedercrantz wrote:
“Easy fix”: Override the -description method and just print what we want (and don’t print any relation)
For example:
- (NSString *)description { return [NSString stringWithFormat@"<%@: %p> id = %@; name = %@;", self.class, self, self.identifier, self.name]; }
— Reply to this email directly or view it on GitHub (https://github.com/opfo/app/issues/12#issuecomment-17156826).
@tdeekens Na, MTLModel
has a default implementation which prints the values for each property.
The isEqual:
and hash
methods still trigger this crasher. @jesjos is fixing that now by overriding them.
Fixed in 453845bbde4159336602b6574423d45988dc031c
When running
[OPFQuestion all:30]
the app becomes unresponsive and then crashes. The log is filled with the same five SQL queries. The problem seems to originate with me trying to log aOPFQuestion
object to the console. The stack trace ends with:and before that there is an enormous amount of calls to
-[MTLModel description] at /App/Pods/Mantle/Mantle/MTLModel.m:187
And the SQL queries:
See the branch feature/search-questions-by-tags, run it and then tap the “questions” row. See the OPFQuestionsViewController class (especially row 230 through 235).