Skip to content

Conversation

@SudoPlz
Copy link

@SudoPlz SudoPlz commented Dec 11, 2025

📜 Description

Exposed the MAX_EVENT_SIZE_BYTES constant as a public field in SentryOptions to allow SDK consumers to access the maximum event size limit (1MB). Previously, this constant was private in the internal EventSizeLimitingUtils class, making it inaccessible to consumers who need to know the size limit for their own calculations or validations.

The constant has been moved from EventSizeLimitingUtils to SentryOptions and EventSizeLimitingUtils now 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?

  • Verified that SentryOptions.MAX_EVENT_SIZE_BYTES is accessible from external code
  • Confirmed that EventSizeLimitingUtils continues to work correctly with the constant reference
  • Ran existing tests to ensure no regressions

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Consider adding documentation or examples showing how consumers can use this constant in their OnOversizedEventCallback implementations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant