Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only delete envelopes when receiving HTTP status code 200 #4458

Open
philipphofmann opened this issue Oct 18, 2024 · 0 comments
Open

Only delete envelopes when receiving HTTP status code 200 #4458

philipphofmann opened this issue Oct 18, 2024 · 0 comments

Comments

@philipphofmann
Copy link
Member

Description

The HTTPTransport only checks if we receive any type of response from the server and then deletes the envelopes. Instead, it should only delete the envelope when receiving a 200, as Java does and as the develop docs recommend.

[self.requestManager
addRequest:request
completionHandler:^(NSHTTPURLResponse *_Nullable response, NSError *_Nullable error) {
if (weakSelf == nil) {
SENTRY_LOG_DEBUG(@"WeakSelf is nil. Not doing anything.");
return;
}
if (error && response.statusCode != 429) {
SENTRY_LOG_DEBUG(@"Request error other than rate limit: %@", error);
[weakSelf recordLostEventFor:envelope.items];
}
if (nil != response) {
SENTRY_LOG_DEBUG(@"Envelope sent successfully!");
[weakSelf.rateLimits update:response];
[weakSelf deleteEnvelopeAndSendNext:envelopePath];
} else {
SENTRY_LOG_DEBUG(@"No internet connection.");
[weakSelf finishedSending];
}
}];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Discussion
Development

No branches or pull requests

1 participant