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 2xx #4458

Open
Tracked by #109
philipphofmann opened this issue Oct 18, 2024 · 1 comment
Open
Tracked by #109

Only delete envelopes when receiving HTTP status code 2xx #4458

philipphofmann opened this issue Oct 18, 2024 · 1 comment

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];
}
}];
}

@kahest
Copy link
Member

kahest commented Oct 23, 2024

Note that we need to make sure we communicate possible impact well in release notes

@kahest kahest moved this from Needs Discussion to Todo in Mobile & Cross Platform SDK Oct 23, 2024
@philipphofmann philipphofmann changed the title Only delete envelopes when receiving HTTP status code 200 Only delete envelopes when receiving HTTP status code 2xx Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants