This method closes the db when it doesn't find a query record that exceeds max query attempts. In this case SQLITE_ROW isn't returned, but rather SQLITE_DONE. When returning SQLITE_DONE, the method should not call handleSQLiteFailure:.
if (keen_io_sqlite3_step(get_query_with_attempts_stmt) == SQLITE_ROW) {
hasFoundEventWithMaxAttempts = YES;
} else {
[self handleSQLiteFailure:@"find query with max attempts"];
return;
}
This method closes the db when it doesn't find a query record that exceeds max query attempts. In this case SQLITE_ROW isn't returned, but rather SQLITE_DONE. When returning SQLITE_DONE, the method should not call handleSQLiteFailure:.
It shouldn't close the db, but just return NO.