Repository navigation
fix(sample): Drop Nav3 Activity ui.load transactions when the toggle is off - #6401
Open
0xadam-brown wants to merge 1 commit into
Open
0xadam-brown wants to merge 1 commit into
0xadam-brown wants to merge 1 commit into
Conversation
…is off The sample cancelled the Activity's ui.load transaction through the scope. When another transaction was already bound, such as the previous Activity's nav transaction, the SDK didn't bind ui.load, so the cancel missed and the transaction was still sent, often waiting the full deadline with the Activity's spans. Keep cancelling a bound ui.load transaction so it doesn't block the first nav transaction, and also drop Nav3 sample Activities' ui.load transactions in an event processor when the Activity was created with the toggle off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
runningcode
approved these changes
Oct 28, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
Looks like this can't compile due to calling java8 APIs. (I can't believe I'm writing that in 2026) see the CI failure! Otherwise, i have a concern about the duration of the stuff under the lock. Approving otherwise!
|
|
||
| /** Drops ui.load transactions for sample Activities created with the ui.load toggle off. */ | ||
| private object SuppressedActivityUiLoadTransactions : EventProcessor { | ||
| val activityNames: MutableSet<String> = ConcurrentHashMap.newKeySet() |
Contributor
There was a problem hiding this comment.
dang, build failure says we need API 24 for this:
val activityNames: MutableSet<String> = ConcurrentHashMap.newKeySet()```
|
|
||
| fun install() { | ||
| if (installed) return | ||
| synchronized(this) { |
Contributor
There was a problem hiding this comment.
for my understanding, is this exclusively called from the main thread?
how long is Sentry.getCurrentScopes().options.addEventProcessor(this) expected to take?
This branch has not been deployed
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
Makes the Nav3 sample's "Activity ui.load transaction" toggle actually drop the Nav3 Activities'
ui.loadtransactions when it's off.The sample used to cancel the
ui.loadtransaction through the scope. That missed it whenever the SDK hadn't bound it, which happens when another transaction (e.g., the previous Activity's nav transaction) is already bound.applyActivityUiLoadTransactionSetting()still cancels a bound transaction, and now also drops unbound ones, through an event processor, for Nav3 Activities created with the toggle off.💡 Motivation and Context
With the toggle off,
Nav3FragmentsActivity,Nav3ProductsActivityandNav3CheckoutActivityui.loadtransactions were still sent, which made manual test runs of the Nav3 scenarios noisy.💚 How did you test it?
On an emulator: with the toggle off, no
ui.loadtransaction is sent forNav3ActivityorNav3FragmentsActivity. With it on, they're sent as before.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog