-
-
Notifications
You must be signed in to change notification settings - Fork 454
Do not report cached events as lost #4575
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
Conversation
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4bd0f22 | 395.69 ms | 448.04 ms | 52.35 ms |
972727c | 393.16 ms | 434.53 ms | 41.37 ms |
d4dcd6e | 399.34 ms | 421.18 ms | 21.84 ms |
020c051 | 431.22 ms | 470.64 ms | 39.42 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
4bd0f22 | 1.58 MiB | 2.09 MiB | 522.32 KiB |
972727c | 1.58 MiB | 2.09 MiB | 519.50 KiB |
d4dcd6e | 1.58 MiB | 2.09 MiB | 522.31 KiB |
020c051 | 1.58 MiB | 2.09 MiB | 519.63 KiB |
* e2e tests for console app * fix test failures by waiting for 10s after first try to find envelopes * add system-test-runner.py script to replace bash scripts for running e2e / system tests * use py script for ci, cleanup, makefile * Format code * remove bash scripts * install requests module * api * fix gh script * Implement E2E tests for OTel based console sample * fixes after merge * Format code * e2e tests for console app * Implement E2E tests for OTel based console sample * fixes after merge * Format code * api * Reduce scope forking when using OpenTelemetry (#4565) * Reduce scope forking in OpenTelemetry * Format code * api * changelog --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> * SDKs send queue is no longer shutdown immediately on re-init (#4564) * Let queue drain on a restart * Format code * Format code * Update sentry-samples/sentry-samples-console-opentelemetry-noagent/src/test/kotlin/sentry/systemtest/ConsoleApplicationSystemTest.kt * Let queue drain on a restart * Format code * Format code * Update sentry-samples/sentry-samples-console-opentelemetry-noagent/src/test/kotlin/sentry/systemtest/ConsoleApplicationSystemTest.kt * adapt tests * changelog --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
@@ -268,7 +268,7 @@ public void run() { | |||
TransportResult result = this.failedResult; | |||
|
|||
envelope.getHeader().setSentAt(null); | |||
envelopeCache.store(envelope, hint); | |||
boolean cached = envelopeCache.storeEnvelope(envelope, hint); |
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.
Since envelopes that were cached previously have a no-op envelope cache here inEnvelopeSender
, this will be false
for envelopes sent from cache.
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
void store(@NotNull SentryEnvelope envelope, @NotNull Hint hint); | ||
|
||
default boolean storeEnvelope(@NotNull SentryEnvelope envelope, @NotNull Hint hint) { |
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.
could you also explicitly implement it in AndroidEnvelopeCache
? I recall there were some issues with desugaring on Unity, where it would crash with NoSuchMethodError for default methods in core sentry
void store(@NotNull SentryEnvelope envelope, @NotNull Hint hint); | ||
|
||
default boolean storeEnvelope(@NotNull SentryEnvelope envelope, @NotNull Hint hint) { | ||
store(envelope, hint); | ||
return true; |
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.
I think we should actually return false
in case an envelope couldn't be stored here, wdyt? Could be because of no storage space, for example.
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.
I left two comments that I think need to be addressed before merging this:
- Implement
storeEnvelope
inAndroidEnvelopeCache
- Return
false
for the case where an envelope could not be stored due to FileSystem issues
As they don't exist anymore and this is done within sentry-native directly: https://github.com/getsentry/sentry-native/pull/1327/files
* fix(android): Remove unused method * Update Changelog
#skip-changelog ## 📜 Description <!--- Describe your changes in detail --> Add rules file for documenting SDK offline behaviour ## 💡 Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> Should help speed up AI reasoning about the SDK offline/retry behaviour. ## 💚 How did you test it? ## 📝 Checklist <!--- Put an `x` in the boxes that apply --> - [ ] 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
* fix: sentry-androi-ndk proguard rule keeps all native class * docs: update CHANGELOG * fix: update CHANGELOG * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Markus Hintersteiner <m.hintersteiner@gmail.com> Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
* perf(connectivity): Cache network capabilities and status to reduce IPC calls * changelog * Changelog * revert * fix(breadcrumbs): Deduplicate battery breadcrumbs * ref * Changelog * Fix test * perf(connectivity): Have only one NetworkCallback active at a time * Changelog * perf(integrations): Use single lifecycle observer * Add tests * Changelog * Fix tests * Improve callback handling and test visibility (#4593) * Null-check lifecycleObserver --------- Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
* fix(sqlite): Fix abstract method error * Update CHANGELOG.md * Suppress metadata version checks
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
default void store(@NotNull SentryEnvelope envelope) { | ||
store(envelope, new Hint()); | ||
storeEnvelope(envelope, new Hint()); |
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.
Bug: Cache Store Failure Masking
The default implementation of IEnvelopeCache.storeEnvelope()
always returns true
, even if a custom implementation of the deprecated store(SentryEnvelope, Hint)
method fails silently. This incorrectly indicates successful caching. Furthermore, the deprecated store(SentryEnvelope)
method calls storeEnvelope()
but ignores its boolean return value, masking storage failures for callers still using this API.
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.
We have to maintain backward compatibility and thus cannot replace the method directly. We are overriding storeEnvelope
in both EnvelopeCache
and AndroidEnvelopeCache
to avoid this problem.
📜 Description
Do not report cached events as lost
💡 Motivation and Context
Fixes #4568
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps