Skip to content

Commit bb72ef8

Browse files
authored
Retry logic updated for Http Response Codes 1xx, 2xx, 3xx and 4xx. (#1525)
* V2 events will be removed from request queue on 1xx, 2xx, 3xx and 4xx response error codes.
1 parent 4e1e300 commit bb72ef8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/BranchSDK/Branch.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,19 +1899,18 @@ static inline void BNCPerformBlockOnMainThreadSync(dispatch_block_t block) {
18991899
}
19001900
}
19011901

1902-
//static inline void BNCPerformBlockOnMainThreadAsync(dispatch_block_t block) {
1903-
// dispatch_async(dispatch_get_main_queue(), block);
1904-
//}
19051902

19061903
- (void) processRequest:(BNCServerRequest*)req
19071904
response:(BNCServerResponse*)response
19081905
error:(NSError*)error {
19091906

19101907
// If the request was successful, or was a bad user request, continue processing.
1908+
// Also skipping retry for 1xx(Informational), 2xx(Success), 3xx(Redirectional Message) and 4xx(Client)error codes.
19111909
if (!error ||
19121910
error.code == BNCTrackingDisabledError ||
19131911
error.code == BNCBadRequestError ||
1914-
error.code == BNCDuplicateResourceError) {
1912+
error.code == BNCDuplicateResourceError ||
1913+
((100 <= error.code) && (error.code <= 499))) {
19151914

19161915
BNCPerformBlockOnMainThreadSync(^{
19171916
[req processResponse:response error:error];

0 commit comments

Comments
 (0)