feat(core): Expose MAX_EVENT_SIZE_BYTES constant in SentryOptions #4962
+5
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 Description
Exposed the
MAX_EVENT_SIZE_BYTESconstant as a public field inSentryOptionsto allow SDK consumers to access the maximum event size limit (1MB). Previously, this constant was private in the internalEventSizeLimitingUtilsclass, making it inaccessible to consumers who need to know the size limit for their own calculations or validations.The constant has been moved from
EventSizeLimitingUtilstoSentryOptionsandEventSizeLimitingUtilsnow references it via static import.💡 Motivation and Context
SDK consumers implementing custom event handling (e.g., in
OnOversizedEventCallback) need access to the maximum event size limit to perform their own size calculations and validations. Without this constant being publicly accessible, consumers would have to hardcode the value or duplicate it, which is error-prone and breaks if the limit changes.💚 How did you test it?
SentryOptions.MAX_EVENT_SIZE_BYTESis accessible from external codeEventSizeLimitingUtilscontinues to work correctly with the constant reference📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
OnOversizedEventCallbackimplementations