Skip to content

fix: remove the dependency on protobuf-lite for tombstones#5157

Merged
supervacuus merged 4 commits intomainfrom
fix/remove_protobuf-lite_dep_tombstone
Mar 9, 2026
Merged

fix: remove the dependency on protobuf-lite for tombstones#5157
supervacuus merged 4 commits intomainfrom
fix/remove_protobuf-lite_dep_tombstone

Conversation

@supervacuus
Copy link
Collaborator

@supervacuus supervacuus commented Mar 5, 2026

📜 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

  • 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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (anr) Profile main thread when ANR and report ANR profiles to Sentry by markushi in #4899

Bug Fixes 🐛

  • Remove the dependency on protobuf-lite for tombstones by supervacuus in #5157

🤖 This preview updates automatically when you update the PR.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() when tombstoneStream is null
    • Added a null guard in TombstoneParser.close() so try-with-resources no longer throws when constructed without an InputStream.

Create PR

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();
+    }
   }
 }
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice straight-forward replacement, looks good to me!

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool stuff!

@sentry
Copy link

sentry bot commented Mar 9, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 333.94 ms 389.08 ms 55.14 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ee747ae 386.94 ms 431.43 ms 44.49 ms
539ca63 313.51 ms 355.43 ms 41.92 ms
22f4345 312.78 ms 347.40 ms 34.62 ms
9fbb112 401.87 ms 515.87 ms 114.00 ms
fcec2f2 357.47 ms 447.32 ms 89.85 ms
d15471f 361.89 ms 378.07 ms 16.18 ms
d15471f 303.49 ms 439.08 ms 135.59 ms
0eaac1e 320.04 ms 369.52 ms 49.48 ms
a5ab36f 320.47 ms 389.77 ms 69.30 ms
27d7cf8 369.82 ms 422.62 ms 52.80 ms

App size

Revision Plain With Sentry Diff
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
539ca63 1.58 MiB 2.12 MiB 551.41 KiB
22f4345 1.58 MiB 2.29 MiB 719.83 KiB
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
0eaac1e 1.58 MiB 2.19 MiB 619.17 KiB
a5ab36f 1.58 MiB 2.12 MiB 555.26 KiB
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB

@supervacuus supervacuus enabled auto-merge (squash) March 9, 2026 11:20
@supervacuus supervacuus disabled auto-merge March 9, 2026 11:21
@supervacuus supervacuus merged commit 08ffa5a into main Mar 9, 2026
65 of 66 checks passed
@supervacuus supervacuus deleted the fix/remove_protobuf-lite_dep_tombstone branch March 9, 2026 12:07
romtsn added a commit to getsentry/rust-proguard that referenced this pull request Mar 10, 2026
## Summary
- Adds a daily GHA workflow that checks if the upstream R8 retrace
mapping spec (`doc/retrace.md`) has been updated
- Mirrors the approach from
[sentry-java#5157](getsentry/sentry-java#5157)
for the tombstone proto schema
- Allows us to react to retrace format changes promptly

## Test plan
- [x] Verified the script runs successfully locally and reports "Spec is
up to date"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants