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

Encode opaque metadata #1708

Merged

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jun 21, 2022

Goal

Detect metadata values that cannot be represented directly in the C layer and encode them as OPAQUE. This includes breadcrumbs which use a OpaqueValue marker object in the Map delivered to the C layer for storage.

Testing

Introduced a new end-to-end test that add complex metadata via the Java layer. This does not fully function yet as the data cannot be retrieved in the error reports (upcoming functionality). The test does however ensure that the new functionality introduces no other failures when adding the metadata.

@lemnik lemnik requested a review from kstenerud June 21, 2022 16:06
@bugsnagbot
Copy link
Collaborator

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1866.07 1617.48
arm64_v8a 655.76 410.0
armeabi_v7a 594.32 344.47
x86 729.47 483.71
x86_64 700.8 455.04

Generated by 🚫 Danger

internal class OpaqueValue(val json: String) {
companion object {
private const val MAX_NDK_STRING_LENGTH = 64
private const val US_ASCII_MAX_CODEPOINT = 128
Copy link
Contributor

Choose a reason for hiding this comment

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

ASCII max codepoint is actually 127, but you also wouldn't want codepoint 127 in a string because it's the DEL control code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 the check for this was actually < 128 but I'll change it to <= 127 for clarity. This value is only used as a short-path to see if every char will fit into a single UTF-8 byte, no encoding is actually done unless the check fails.

…eanup old OPAQUE values when they are no longer reachable
@lemnik lemnik force-pushed the PLAT-8582/encode-opaque-metadata branch from 63ea0b1 to a41a5f3 Compare June 22, 2022 12:37
@lemnik lemnik marked this pull request as ready for review June 22, 2022 15:02
@lemnik lemnik merged commit 81907b3 into integration/opaque-metadata Jun 22, 2022
@lemnik lemnik deleted the PLAT-8582/encode-opaque-metadata branch June 22, 2022 15:47
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