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

Improve error handling + make MAX_REPORT_BYTES configurable #332

Open
ncreated opened this issue Dec 16, 2024 · 1 comment
Open

Improve error handling + make MAX_REPORT_BYTES configurable #332

ncreated opened this issue Dec 16, 2024 · 1 comment

Comments

@ncreated
Copy link

Hi 👋,

At Datadog, we use PLCR to power our crash reporting product and have been generally very happy with it—thanks for the great work 🏅🙂.

Recently, we investigated the following error among users of version 1.11.2 of PLCR:

"An unknown error occurred decoding the crash report."

We suspect the root cause is the same as in #305. The library has a hardcoded size limit (MAX_REPORT_BYTES) for decoding crash reports, and if this limit is exceeded, PLCR fails with the "An unknown error ..." message. The 1MB limit (increased from 256KB in #308) seems reasonable, however we believe it can still be insufficient for certain apps—especially those using RxSwift in their stack traces or loading large numbers of libraries.

While it could be debated how often these limits are exceeded and what the limit should be, we believe PLCR could benefit from two improvements:

1. Improve the error message when exceeding "max report size"

The current error message lacks context on whether the failure is due to exceeding MAX_REPORT_BYTES or another issue. We suggest adding a more specific error, such as:

"Could not decode crash report because it exceeds max size (actual size: ... bytes, max size: ... bytes)"

This would provide actionable data to help better adjust the default limit for each app.

2. Make the "max report size" configurable

Although increasing the size limit from 256KB to 1MB helped in #305, we believe some reports will always exceed a fixed limit. We propose adding a configurable option for the max crash report size, allowing developers to adjust it based on their app’s needs. This would accommodate apps with larger stack traces or more binary images.


We are motivated to contribute these changes to PLCR if you agree. Looking forward to your thoughts!

@MikhailSuendukov
Copy link
Contributor

Hello, and thank you for reaching out to us! The improvements you suggested are reasonable. We welcome your contributions and would be glad to review them.

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

No branches or pull requests

2 participants