Manos Chorianopoulos

fix refresh token crash

...@@ -594,7 +594,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -594,7 +594,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
594 }]; 594 }];
595 } failureBlock:^(NSError *error) { 595 } failureBlock:^(NSError *error) {
596 if (failure) { 596 if (failure) {
597 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 597 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
598 failure(error); 598 failure(error);
599 } 599 }
600 NSLog(@"Error at token %@", error ); 600 NSLog(@"Error at token %@", error );
...@@ -969,7 +969,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -969,7 +969,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
969 success(successResponse); 969 success(successResponse);
970 } failureBlock:^(NSError *error) { 970 } failureBlock:^(NSError *error) {
971 if (failure) { 971 if (failure) {
972 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 972 +// [_db executeUpdate:@"DROP TABLE requestVariables"];
973 failure(error); 973 failure(error);
974 } 974 }
975 NSLog(@"Error at token %@", error ); 975 NSLog(@"Error at token %@", error );
...@@ -983,100 +983,106 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -983,100 +983,106 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
983 983
984 - (void)refreshToken2ndTry:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 984 - (void)refreshToken2ndTry:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
985 { 985 {
986 - FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"]; 986 + if ([_db tableExists:@"requestVariables"] == YES) {
987 - NSString *refreshToken = [NSString alloc]; 987 + FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"];
988 - while ([refreshTokenSet next]) { 988 + NSString *refreshToken = [NSString alloc];
989 - refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue]; 989 + while ([refreshTokenSet next]) {
990 - } 990 + refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue];
991 - FMResultSet *clientIdSet = [_db executeQuery:@"SELECT client_id FROM requestVariables WHERE id = 1;"]; 991 + }
992 - NSString *clientId = [NSString alloc]; 992 + FMResultSet *clientIdSet = [_db executeQuery:@"SELECT client_id FROM requestVariables WHERE id = 1;"];
993 - while ([clientIdSet next]) { 993 + NSString *clientId = [NSString alloc];
994 - clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue]; 994 + while ([clientIdSet next]) {
995 - } 995 + clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue];
996 - FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"]; 996 + }
997 - NSString *clientSecret = [NSString alloc]; 997 + FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"];
998 - while ([clientSecretSet next]) { 998 + NSString *clientSecret = [NSString alloc];
999 - clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue]; 999 + while ([clientSecretSet next]) {
1000 - } 1000 + clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue];
1001 - 1001 + }
1002 - NSDictionary *postDictionary3 = @{@"client_id": clientId, @"client_secret": clientSecret, @"refresh_token": refreshToken, @"grant_type":@"refresh_token", }; 1002 +
1003 - NSData *jsonData3 = [NSJSONSerialization dataWithJSONObject:postDictionary3 options:0 error:NULL]; 1003 + NSDictionary *postDictionary3 = @{@"client_id": clientId, @"client_secret": clientSecret, @"refresh_token": refreshToken, @"grant_type":@"refresh_token", };
1004 - [self sendContext5:jsonData3 successBlock:^(NSDictionary *contextResponse) { 1004 + NSData *jsonData3 = [NSJSONSerialization dataWithJSONObject:postDictionary3 options:0 error:NULL];
1005 - if (success) { 1005 + [self sendContext5:jsonData3 successBlock:^(NSDictionary *contextResponse) {
1006 - [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [contextResponse objectForKey:@"access_token"], [contextResponse objectForKey:@"refresh_token"]]; 1006 + if (success) {
1007 - NSDictionary *successResponse = @{@"result": @"success", @"status":@1}; 1007 + [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [contextResponse objectForKey:@"access_token"], [contextResponse objectForKey:@"refresh_token"]];
1008 - success(successResponse); 1008 + NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
1009 - } 1009 + success(successResponse);
1010 - } failureBlock:^(NSError *error) { 1010 + }
1011 - if (failure) {
1012 - NSDictionary* dict = [NSDictionary alloc];
1013 - dict = [error userInfo];
1014 - NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1015 - if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1016 - [self refreshToken3rdTry:^(NSDictionary *response) {
1017 -// [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [response objectForKey:@"access_token"], [response objectForKey:@"refresh_token"]];
1018 - NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
1019 - success(successResponse);
1020 } failureBlock:^(NSError *error) { 1011 } failureBlock:^(NSError *error) {
1021 - if (failure) { 1012 + if (failure) {
1022 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1013 + NSDictionary* dict = [NSDictionary alloc];
1023 - failure(error); 1014 + dict = [error userInfo];
1024 - } 1015 + NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1025 - NSLog(@"Error at token %@", error ); 1016 + if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1017 + [self refreshToken3rdTry:^(NSDictionary *response) {
1018 + // [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [response objectForKey:@"access_token"], [response objectForKey:@"refresh_token"]];
1019 + NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
1020 + success(successResponse);
1021 + } failureBlock:^(NSError *error) {
1022 + if (failure) {
1023 +// [_db executeUpdate:@"DROP TABLE requestVariables"];
1024 + failure(error);
1025 + }
1026 + NSLog(@"Error at token %@", error );
1027 + }];
1028 + }
1029 + NSLog(@"Error at token %@", error );
1030 + }
1026 }]; 1031 }];
1027 - } 1032 + }
1028 - NSLog(@"Error at token %@", error );
1029 - }
1030 - }];
1031 } 1033 }
1032 1034
1033 - (void)refreshToken3rdTry:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1035 - (void)refreshToken3rdTry:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1034 { 1036 {
1035 - FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"]; 1037 + if ([_db tableExists:@"requestVariables"] == YES) {
1036 - NSString *refreshToken = [NSString alloc]; 1038 + FMResultSet *refreshTokenSet = [_db executeQuery:@"SELECT refresh_token FROM requestVariables WHERE id = 1;"];
1037 - while ([refreshTokenSet next]) { 1039 + NSString *refreshToken = [NSString alloc];
1038 - refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue]; 1040 + while ([refreshTokenSet next]) {
1039 - } 1041 + refreshToken = [[refreshTokenSet resultDictionary][@"refresh_token"] stringValue];
1040 - FMResultSet *clientIdSet = [_db executeQuery:@"SELECT client_id FROM requestVariables WHERE id = 1;"]; 1042 + }
1041 - NSString *clientId = [NSString alloc]; 1043 + FMResultSet *clientIdSet = [_db executeQuery:@"SELECT client_id FROM requestVariables WHERE id = 1;"];
1042 - while ([clientIdSet next]) { 1044 + NSString *clientId = [NSString alloc];
1043 - clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue]; 1045 + while ([clientIdSet next]) {
1044 - } 1046 + clientId = [[clientIdSet resultDictionary][@"client_id"] stringValue];
1045 - FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"]; 1047 + }
1046 - NSString *clientSecret = [NSString alloc]; 1048 + FMResultSet *clientSecretSet = [_db executeQuery:@"SELECT client_secret FROM requestVariables WHERE id = 1;"];
1047 - while ([clientSecretSet next]) { 1049 + NSString *clientSecret = [NSString alloc];
1048 - clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue]; 1050 + while ([clientSecretSet next]) {
1049 - } 1051 + clientSecret = [[clientSecretSet resultDictionary][@"client_secret"] stringValue];
1050 - 1052 + }
1051 - NSDictionary *postDictionary3 = @{@"client_id": clientId, @"client_secret": clientSecret, @"refresh_token": refreshToken, @"grant_type":@"refresh_token", }; 1053 +
1052 - NSData *jsonData3 = [NSJSONSerialization dataWithJSONObject:postDictionary3 options:0 error:NULL]; 1054 + NSDictionary *postDictionary3 = @{@"client_id": clientId, @"client_secret": clientSecret, @"refresh_token": refreshToken, @"grant_type":@"refresh_token", };
1053 - [self sendContext5:jsonData3 successBlock:^(NSDictionary *contextResponse) { 1055 + NSData *jsonData3 = [NSJSONSerialization dataWithJSONObject:postDictionary3 options:0 error:NULL];
1054 - if (success) { 1056 + [self sendContext5:jsonData3 successBlock:^(NSDictionary *contextResponse) {
1055 - [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [contextResponse objectForKey:@"access_token"], [contextResponse objectForKey:@"refresh_token"]]; 1057 + if (success) {
1056 - NSDictionary *successResponse = @{@"result": @"success", @"status":@1}; 1058 + [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [contextResponse objectForKey:@"access_token"], [contextResponse objectForKey:@"refresh_token"]];
1057 - success(successResponse); 1059 + NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
1058 - } 1060 + success(successResponse);
1059 - } failureBlock:^(NSError *error) { 1061 + }
1060 - if (failure) { 1062 + } failureBlock:^(NSError *error) {
1061 - NSDictionary* dict = [NSDictionary alloc]; 1063 + if (failure) {
1062 - dict = [error userInfo]; 1064 + NSDictionary* dict = [NSDictionary alloc];
1063 - NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"]; 1065 + dict = [error userInfo];
1064 - if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) { 1066 + NSString* errorCode = [dict objectForKey:@"NSLocalizedDescription"];
1065 -// [self refreshToken:^(NSDictionary *response) { 1067 + if ([errorCode isEqual:@"Request failed: unauthorized (401)"]) {
1066 -// // [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [response objectForKey:@"access_token"], [response objectForKey:@"refresh_token"]]; 1068 + // [self refreshToken:^(NSDictionary *response) {
1067 -// NSDictionary *successResponse = @{@"result": @"success", @"status":@1}; 1069 + // // [_db executeUpdate:@"UPDATE requestVariables SET access_token = ?, refresh_token = ? WHERE id = 1", [response objectForKey:@"access_token"], [response objectForKey:@"refresh_token"]];
1068 -// success(successResponse); 1070 + // NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
1069 -// } failureBlock:^(NSError *error) { 1071 + // success(successResponse);
1070 - if (failure) { 1072 + // } failureBlock:^(NSError *error) {
1071 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1073 + if (failure) {
1072 - failure(error); 1074 + if ([_db tableExists:@"requestVariables"] == YES) {
1073 - } 1075 + [_db executeUpdate:@"DROP TABLE requestVariables"];
1074 - NSLog(@"Error at token %@", error ); 1076 + }
1075 - // }]; 1077 + failure(error);
1076 - } 1078 + }
1077 - NSLog(@"Error at token %@", error ); 1079 + NSLog(@"Error at token %@", error );
1078 - } 1080 + // }];
1079 - }]; 1081 + }
1082 + NSLog(@"Error at token %@", error );
1083 + }
1084 + }];
1085 + }
1080 } 1086 }
1081 1087
1082 - (void)changePasswordWithSuccessBlock:(NSString*)oldPassword andNewPassword:(NSString*)newPassword :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1088 - (void)changePasswordWithSuccessBlock:(NSString*)oldPassword andNewPassword:(NSString*)newPassword :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
...@@ -1105,7 +1111,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1105,7 +1111,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1105 }]; 1111 }];
1106 } failureBlock:^(NSError *error) { 1112 } failureBlock:^(NSError *error) {
1107 if (failure) { 1113 if (failure) {
1108 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1114 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1109 failure(error); 1115 failure(error);
1110 } 1116 }
1111 NSLog(@"Error at token %@", error ); 1117 NSLog(@"Error at token %@", error );
...@@ -1148,7 +1154,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1148,7 +1154,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1148 }]; 1154 }];
1149 } failureBlock:^(NSError *error) { 1155 } failureBlock:^(NSError *error) {
1150 if (failure) { 1156 if (failure) {
1151 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1157 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1152 failure(error); 1158 failure(error);
1153 } 1159 }
1154 NSLog(@"Error at token %@", error ); 1160 NSLog(@"Error at token %@", error );
...@@ -1209,7 +1215,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1209,7 +1215,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1209 }]; 1215 }];
1210 } failureBlock:^(NSError *error) { 1216 } failureBlock:^(NSError *error) {
1211 if (failure) { 1217 if (failure) {
1212 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1218 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1213 failure(error); 1219 failure(error);
1214 } 1220 }
1215 NSLog(@"Error at token %@", error ); 1221 NSLog(@"Error at token %@", error );
...@@ -1315,7 +1321,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1315,7 +1321,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1315 }]; 1321 }];
1316 } failureBlock:^(NSError *error) { 1322 } failureBlock:^(NSError *error) {
1317 if (failure) { 1323 if (failure) {
1318 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1324 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1319 failure(error); 1325 failure(error);
1320 } 1326 }
1321 NSLog(@"Error at token %@", error ); 1327 NSLog(@"Error at token %@", error );
...@@ -1356,7 +1362,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1356,7 +1362,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1356 }]; 1362 }];
1357 } failureBlock:^(NSError *error) { 1363 } failureBlock:^(NSError *error) {
1358 if (failure) { 1364 if (failure) {
1359 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1365 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1360 failure(error); 1366 failure(error);
1361 } 1367 }
1362 NSLog(@"Error at token %@", error ); 1368 NSLog(@"Error at token %@", error );
...@@ -1397,7 +1403,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1397,7 +1403,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1397 }]; 1403 }];
1398 } failureBlock:^(NSError *error) { 1404 } failureBlock:^(NSError *error) {
1399 if (failure) { 1405 if (failure) {
1400 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1406 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1401 failure(error); 1407 failure(error);
1402 } 1408 }
1403 NSLog(@"Error at token %@", error ); 1409 NSLog(@"Error at token %@", error );
...@@ -1475,7 +1481,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1475,7 +1481,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1475 }]; 1481 }];
1476 } failureBlock:^(NSError *error) { 1482 } failureBlock:^(NSError *error) {
1477 if (failure) { 1483 if (failure) {
1478 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1484 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1479 failure(error); 1485 failure(error);
1480 } 1486 }
1481 NSLog(@"Error at token %@", error ); 1487 NSLog(@"Error at token %@", error );
...@@ -1512,7 +1518,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1512,7 +1518,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1512 }]; 1518 }];
1513 } failureBlock:^(NSError *error) { 1519 } failureBlock:^(NSError *error) {
1514 if (failure) { 1520 if (failure) {
1515 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1521 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1516 failure(error); 1522 failure(error);
1517 } 1523 }
1518 NSLog(@"Error at token %@", error ); 1524 NSLog(@"Error at token %@", error );
...@@ -1549,7 +1555,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1549,7 +1555,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1549 }]; 1555 }];
1550 } failureBlock:^(NSError *error) { 1556 } failureBlock:^(NSError *error) {
1551 if (failure) { 1557 if (failure) {
1552 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1558 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1553 failure(error); 1559 failure(error);
1554 } 1560 }
1555 NSLog(@"Error at token %@", error ); 1561 NSLog(@"Error at token %@", error );
...@@ -1586,7 +1592,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1586,7 +1592,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1586 }]; 1592 }];
1587 } failureBlock:^(NSError *error) { 1593 } failureBlock:^(NSError *error) {
1588 if (failure) { 1594 if (failure) {
1589 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1595 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1590 failure(error); 1596 failure(error);
1591 } 1597 }
1592 NSLog(@"Error at token %@", error ); 1598 NSLog(@"Error at token %@", error );
...@@ -1623,7 +1629,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1623,7 +1629,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1623 }]; 1629 }];
1624 } failureBlock:^(NSError *error) { 1630 } failureBlock:^(NSError *error) {
1625 if (failure) { 1631 if (failure) {
1626 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1632 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1627 failure(error); 1633 failure(error);
1628 } 1634 }
1629 NSLog(@"Error at token %@", error ); 1635 NSLog(@"Error at token %@", error );
...@@ -1738,7 +1744,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1738,7 +1744,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1738 }]; 1744 }];
1739 } failureBlock:^(NSError *error) { 1745 } failureBlock:^(NSError *error) {
1740 if (failure) { 1746 if (failure) {
1741 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1747 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1742 failure(error); 1748 failure(error);
1743 } 1749 }
1744 NSLog(@"Error at token %@", error ); 1750 NSLog(@"Error at token %@", error );
...@@ -1775,7 +1781,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1775,7 +1781,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1775 }]; 1781 }];
1776 } failureBlock:^(NSError *error) { 1782 } failureBlock:^(NSError *error) {
1777 if (failure) { 1783 if (failure) {
1778 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1784 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1779 failure(error); 1785 failure(error);
1780 } 1786 }
1781 NSLog(@"Error at token %@", error ); 1787 NSLog(@"Error at token %@", error );
...@@ -1812,7 +1818,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1812,7 +1818,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1812 }]; 1818 }];
1813 } failureBlock:^(NSError *error) { 1819 } failureBlock:^(NSError *error) {
1814 if (failure) { 1820 if (failure) {
1815 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1821 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1816 failure(error); 1822 failure(error);
1817 } 1823 }
1818 NSLog(@"Error at token %@", error ); 1824 NSLog(@"Error at token %@", error );
...@@ -1853,7 +1859,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1853,7 +1859,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1853 }]; 1859 }];
1854 } failureBlock:^(NSError *error) { 1860 } failureBlock:^(NSError *error) {
1855 if (failure) { 1861 if (failure) {
1856 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1862 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1857 failure(error); 1863 failure(error);
1858 } 1864 }
1859 NSLog(@"Error at token %@", error ); 1865 NSLog(@"Error at token %@", error );
...@@ -1890,7 +1896,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1890,7 +1896,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1890 }]; 1896 }];
1891 } failureBlock:^(NSError *error) { 1897 } failureBlock:^(NSError *error) {
1892 if (failure) { 1898 if (failure) {
1893 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1899 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1894 failure(error); 1900 failure(error);
1895 } 1901 }
1896 NSLog(@"Error at token %@", error ); 1902 NSLog(@"Error at token %@", error );
...@@ -1927,7 +1933,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -1927,7 +1933,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
1927 }]; 1933 }];
1928 } failureBlock:^(NSError *error) { 1934 } failureBlock:^(NSError *error) {
1929 if (failure) { 1935 if (failure) {
1930 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 1936 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
1931 failure(error); 1937 failure(error);
1932 } 1938 }
1933 NSLog(@"Error at token %@", error ); 1939 NSLog(@"Error at token %@", error );
...@@ -2009,7 +2015,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2009,7 +2015,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2009 }]; 2015 }];
2010 } failureBlock:^(NSError *error) { 2016 } failureBlock:^(NSError *error) {
2011 if (failure) { 2017 if (failure) {
2012 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2018 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2013 failure(error); 2019 failure(error);
2014 } 2020 }
2015 NSLog(@"Error at token %@", error ); 2021 NSLog(@"Error at token %@", error );
...@@ -2046,7 +2052,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2046,7 +2052,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2046 }]; 2052 }];
2047 } failureBlock:^(NSError *error) { 2053 } failureBlock:^(NSError *error) {
2048 if (failure) { 2054 if (failure) {
2049 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2055 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2050 failure(error); 2056 failure(error);
2051 } 2057 }
2052 NSLog(@"Error at token %@", error ); 2058 NSLog(@"Error at token %@", error );
...@@ -2083,7 +2089,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2083,7 +2089,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2083 }]; 2089 }];
2084 } failureBlock:^(NSError *error) { 2090 } failureBlock:^(NSError *error) {
2085 if (failure) { 2091 if (failure) {
2086 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2092 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2087 failure(error); 2093 failure(error);
2088 } 2094 }
2089 NSLog(@"Error at token %@", error ); 2095 NSLog(@"Error at token %@", error );
...@@ -2295,7 +2301,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2295,7 +2301,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2295 }]; 2301 }];
2296 } failureBlock:^(NSError *error) { 2302 } failureBlock:^(NSError *error) {
2297 if (failure) { 2303 if (failure) {
2298 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2304 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2299 failure(error); 2305 failure(error);
2300 } 2306 }
2301 NSLog(@"Error at token %@", error ); 2307 NSLog(@"Error at token %@", error );
...@@ -2355,7 +2361,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2355,7 +2361,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2355 }]; 2361 }];
2356 } failureBlock:^(NSError *error) { 2362 } failureBlock:^(NSError *error) {
2357 if (failure) { 2363 if (failure) {
2358 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2364 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2359 failure(error); 2365 failure(error);
2360 } 2366 }
2361 NSLog(@"Error at token %@", error ); 2367 NSLog(@"Error at token %@", error );
...@@ -2396,7 +2402,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2396,7 +2402,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2396 }]; 2402 }];
2397 } failureBlock:^(NSError *error) { 2403 } failureBlock:^(NSError *error) {
2398 if (failure) { 2404 if (failure) {
2399 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2405 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2400 failure(error); 2406 failure(error);
2401 } 2407 }
2402 NSLog(@"Error at token %@", error ); 2408 NSLog(@"Error at token %@", error );
...@@ -2437,7 +2443,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2437,7 +2443,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2437 }]; 2443 }];
2438 } failureBlock:^(NSError *error) { 2444 } failureBlock:^(NSError *error) {
2439 if (failure) { 2445 if (failure) {
2440 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2446 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2441 failure(error); 2447 failure(error);
2442 } 2448 }
2443 NSLog(@"Error at token %@", error ); 2449 NSLog(@"Error at token %@", error );
...@@ -2478,7 +2484,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2478,7 +2484,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2478 }]; 2484 }];
2479 } failureBlock:^(NSError *error) { 2485 } failureBlock:^(NSError *error) {
2480 if (failure) { 2486 if (failure) {
2481 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2487 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2482 failure(error); 2488 failure(error);
2483 } 2489 }
2484 NSLog(@"Error at token %@", error ); 2490 NSLog(@"Error at token %@", error );
...@@ -2538,7 +2544,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2538,7 +2544,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2538 }]; 2544 }];
2539 } failureBlock:^(NSError *error) { 2545 } failureBlock:^(NSError *error) {
2540 if (failure) { 2546 if (failure) {
2541 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2547 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2542 failure(error); 2548 failure(error);
2543 } 2549 }
2544 NSLog(@"Error at token %@", error ); 2550 NSLog(@"Error at token %@", error );
...@@ -2575,7 +2581,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -2575,7 +2581,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
2575 }]; 2581 }];
2576 } failureBlock:^(NSError *error) { 2582 } failureBlock:^(NSError *error) {
2577 if (failure) { 2583 if (failure) {
2578 - [_db executeUpdate:@"DROP TABLE requestVariables"]; 2584 + // [_db executeUpdate:@"DROP TABLE requestVariables"];
2579 failure(error); 2585 failure(error);
2580 } 2586 }
2581 NSLog(@"Error at token %@", error ); 2587 NSLog(@"Error at token %@", error );
......