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

UI Event Transactions - iOS and Android #4

Closed
4 tasks done
philipphofmann opened this issue May 6, 2022 · 1 comment
Closed
4 tasks done

UI Event Transactions - iOS and Android #4

philipphofmann opened this issue May 6, 2022 · 1 comment

Comments

@philipphofmann
Copy link
Member

philipphofmann commented May 6, 2022

The goal of UI transactions is to capture transactions based on user interactions. Currently, the offer of auto-generated transactions on mobile is limited, with only creating transactions when an app loads a screen. To provide more value, we want to extend the auto-generated transactions by generating transactions on UI events.

Internal Notion page. https://getsentry.atlassian.net/browse/MOBILE-239

The default idle timeout is 3 seconds.

Scenarios

Scenarios are written in the Gherkin syntax.

Scenario: Discard UI event transactions without child spans

Given an auto-generated UI event transaction
And the transaction has no child spans
When the idleTimeout times out
Then the SDK discards the transaction 

An empty transaction of a UI event doesn’t add any value.

Scenario: Set time to last finished child span

Given an auto-generated UI event transaction
And the transaction has one finished child span
When the idleTimeout times out
Then the SDK finishes the transaction
And trims the end time of the transaction to the one of the latest finished child span

Scenario: Don't reset timeout when the second last span finishes

Given an auto-generated UI event transaction
And the transaction has two child spans
When the SDK finishes the first child span
Then the SDK doesn't reset the idle timeout

Scenario: Reset timeout when the last span finishes

Given an auto-generated UI event transaction
And the transaction has two child spans
When the SDK finishes the second child span
Then the SDK resets the idle timeout

Scenario: Cancel timeout when starting a span

Given an auto-generated UI event transaction
When the SDK starts a child span
Then the SDK cancels the idle timeout
And waits for the child to finish

Scenario: Ongoing screen load transaction

Given an ongoing screen load transaction
When the SDK starts a new UI event transaction
Then the SDK doesn’t bind the new transaction to the scope

Scenario: Ongoing UI event transaction

Given an ongoing UI event transaction
When the SDK creates a new screen load transaction
Then the SDK finishes the previous transactions
And removes it from the scope
And sets the status to canceled
And waits for its children to finish

Scenario: Manually created transaction on the scope

Given an ongoing manually transaction bound to the scope by the user
When the SDK creates a new auto-generated transaction
Then the SDK doesn’t add the new auto-generated transaction to the scope 

Scenario: Same UI element with same event

Given an ongoing UI event transaction
When the user triggers the same UI event with the same type
Then the SDK resets the timeout
And doesn’t create a new transaction

Scenario: Same UI element with different event

Given an ongoing UI event transaction
When the user triggers the same UI element with a different event
Or the user triggers the different UI element
Then the SDK finishes the ongoing transaction
And sets the status to OK
And waits for the children to finish
And cancels the timeout (Actually, it shouldn't make a difference if you cancel it or not, as the SDK will add new spans to the new transaction)
And removes the ongoing transaction from the scope
And starts a new transaction
And puts the new transaction on the scope

Scenario: UI event triggered but transaction ended

Given an auto-generated transaction from a any event
And the transaction finished
When the user triggers the same event
Then the SDK starts a new transaction

Scenario: Transaction name

When the user clicks a button
Then the SDK starts a transaction
And the transaction name is the [[screen.name](http://screen.name/)](http://screen.name) + [[view.id](http://view.id/)](http://view.id) or the accessibility identifier of the view (e.g. `LoginActivity.login_button`)

Scenario: Transaction name [view.id](http://view.id) or accessibility identifier not specified

When the user clicks a button
And the button has no [[view.id](http://view.id/)](http://view.id) or accessibility identifier
Then the SDK doesn’t start a transaction
And prints a warning to the console

@bruno-garcia bruno-garcia changed the title UI Event Transactions UI Event Transactions - iOS and Android May 9, 2022
@bruno-garcia bruno-garcia moved this from In Progress to Backlog in Mobile & Cross Platform SDK Jul 15, 2022
@zoesyc zoesyc moved this to In Progress 📈 in Mobile Planning Jul 28, 2022
@zoesyc zoesyc moved this to EA 🏁 in Mobile Planning Sep 9, 2022
@zoesyc zoesyc removed the status in Mobile Planning Sep 9, 2022
@zoesyc zoesyc removed this from Mobile Planning Sep 12, 2022
@philipphofmann
Copy link
Member Author

The only issue that stopped this from marking as closed is getsentry/sentry-cocoa#1977. We keep track of that issue in the Cocoa SDK and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants