| [ Web Proxy ] |
| Viewing: https://github-redirect.dependabot.com/getsentry/sentry-cocoa/issues/7261 | [Back] [Original] |
Implements error logging for HTTP 413 (Content Too Large) responses to help users understand why their envelopes are being rejected. The error message includes the envelope size in bytes and item types. Fixes #7248
Semver Impact of This PRMinor (new features) Changelog PreviewThis is how your changes will appear in the changelog. New Features
Bug Fixes
Internal Changes
Other
This preview updates automatically when you update the PR. |
|
Codecov Report All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #7261 +/- ##
=============================================
- Coverage 85.050% 85.039% -0.012%
=============================================
Files 470 472 +2
Lines 28396 28414 +18
Branches 12464 12468 +4
=============================================
+ Hits 24151 24163 +12
- Misses 4199 4202 +3
- Partials 46 49 +3
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Performance metrics
Baseline results on branch: mainStartup times
App size
Previous results on branch: feat/http-413-loggingStartup times
App size
|
There was a problem hiding this comment.
LGTM
andling Introduces a new Swift enum to replace magic numbers with named constants for HTTP status codes. The enum is accessible from both Swift and Objective-C and includes custom equality operators for seamless Int comparison without requiring .rawValue. All status codes include MDN documentation references. Updated SentryHttpTransportHttpStatusCodeLogger and its tests to use the enum, improving code readability and type safety.
P transport - Renamed SentryHttpStatusCodes to SentryHttpStatusCode (singular) for consistency - Added HTTP 201 Created and 400 Bad Request status codes - Updated SentryHttpTransport to use enum values for status code comparisons (200, 400, 429) - Added comprehensive test suite for enum equality operators - All equality operators support direct Int comparison without .rawValue Updated files: - SentryHttpStatusCode.swift (renamed from SentryHttpStatusCodes.swift) - SentryHttpTransport.m: Uses enum for 200, 400, and 429 status codes - SentryHttpTransportHttpStatusCodeLogger.swift: Updated enum references - Tests: Updated all test files to use renamed enum - Added SentryHttpStatusCodeTests.swift with 11 tests for equality and raw value verification
ests - Renamed raw value tests to status code value tests - Changed all but one test to use == operator instead of .rawValue - Kept one raw value test (testRawValue_shouldReturnCorrectInt) to verify rawValue works - All 12 tests passing
Changed from (200 == SentryHttpStatusCode.ok) to (SentryHttpStatusCode.ok == 200) for more natural reading order.
|
@philprime, I added the HTTP status code enum. Please have another look |
Regenerated sdk_api.json to include the new SentryHttpStatusCode enum exposed to Objective-C via @objc annotation.
Removed @_spi(Private) and public modifiers from the equality operators. These operators are only needed within the module and don't need to be exposed as SPI.
There was a problem hiding this comment.
LGTM
| Web Proxy Viewer | New URL | Original Page |
Description
Implements error logging for HTTP 413 (Content Too Large) responses to help users understand why their envelopes are being rejected. When the SDK receives an HTTP 413 response, it now logs an error message.
Motivation and Context
Fixes #7248
Users need visibility into why their envelopes are being rejected by the server. HTTP 413 responses indicate the envelope is too large, but without detailed logging, it's difficult to diagnose which events or attachments are causing the issue.
This follows the Sentry SDK specification: https://develop.sentry.dev/sdk/expected-features/#dealing-with-network-failures
How did you test it?
Unit tests and tested with a sample app and capturing a message exceeding 1 MiB to double-check if Relay returns 413.
Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.