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
Isolate cached events with hashed dsn subfolder #2038
Conversation
sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The only thing is whether we should cache the profilingTraceDirPath and outboxPath in SentryOptions
instead of evaluating the cache file every time.
But they should already be cached by the sdk components that use them, so i think it's fine.
sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java
Show resolved
Hide resolved
It's only being used when creating the integrations, and it does not do IO, the File class just makes sure that it has the right file separator, etc. |
Codecov Report
@@ Coverage Diff @@
## 6.x.x #2038 +/- ##
========================================
Coverage ? 80.87%
Complexity ? 3176
========================================
Files ? 228
Lines ? 11736
Branches ? 1576
========================================
Hits ? 9492
Misses ? 1655
Partials ? 589 Continue to review full report at Codecov.
|
final StringBuilder stringBuilder = new StringBuilder(no.toString(16)); | ||
|
||
// Add preceding 0s to make it 32 bit | ||
while (stringBuilder.length() < 32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a 32 character long string?
I don't believe we're reducing the risk of collision with this so maybe we can go without this altogether. (seems like this came from here, they likely needed a fixed size, but we don't).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, no need to be fixed size, but iOS also uses something similar https://github.com/getsentry/sentry-cocoa/blob/e254b733f7706d4c04c02093f5ad0715ced92443/Sources/Sentry/SentryDsn.m
CC_SHA1_DIGEST_LENGTH * 2
so it might be fixed size as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In iOS is just looks like it's allocating a string twice the size the number of bytes used in the digest creation. It's an optimization.
It's a copy paste from:https://stackoverflow.com/questions/7570377/creating-sha1-hash-from-nsstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Other than prepending the |
📜 Description
Isolate cached events with hashed dsn subfolder
💡 Motivation and Context
Closes #2026
💚 How did you test it?
📝 Checklist
🔮 Next steps
dd to the migration page.