fix: remove the dependency on protobuf-lite for tombstones#5157
Open
supervacuus wants to merge 3 commits intomainfrom
Open
fix: remove the dependency on protobuf-lite for tombstones#5157supervacuus wants to merge 3 commits intomainfrom
supervacuus wants to merge 3 commits intomainfrom
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
...ry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: NPE in
close()whentombstoneStreamis null- Added a null guard in
TombstoneParser.close()so try-with-resources no longer throws when constructed without an InputStream.
- Added a null guard in
Or push these changes by commenting:
@cursor push 9737b16a1a
Preview (9737b16a1a)
diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java b/sentry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java
--- a/sentry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java
+++ b/sentry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java
@@ -349,6 +349,8 @@
@Override
public void close() throws IOException {
- tombstoneStream.close();
+ if (tombstoneStream != null) {
+ tombstoneStream.close();
+ }
}
}
...ry-android-core/src/main/java/io/sentry/android/core/internal/tombstone/TombstoneParser.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
As the title says, it replaces the dependency on a huge generic protobuf decoder with a tiny tombstone-specific package called
epitaph(GH, central). The dependency is MIT licensed and can be incorporated into the Sentry ecosystem in whichever ways make sense down the road.💡 Motivation and Context
Part of the wrap-up milestone in https://linear.app/getsentry/project/tombstone-support-android-0024cb6e3ffd
https://linear.app/getsentry/issue/ANDROID-267/switch-to-dependency-free-protobuf-runtime
💚 How did you test it?
Tested the same way as the dependency it replaces. The library, though, has a battery of test cases for encoding errors and edge cases.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps