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

Add Fragment Transactions #3719

Open
romtsn opened this issue Sep 25, 2024 · 4 comments
Open

Add Fragment Transactions #3719

romtsn opened this issue Sep 25, 2024 · 4 comments

Comments

@romtsn
Copy link
Member

romtsn commented Sep 25, 2024

Description

In the light of #1810, we're still not really there yet with the Manual Screens API and only-spans, so this might be a interim solution to support single-activity apps and create transactions bound to scope automatically for our fragment integration. This has several tricky things to figure out:

  • What is considered a screen when fragments are used?
    • If androidx.navigation is used we could use our integration to create transaction whenever a route changes
    • otherwise we could by default always create transaction and then provide a lambda/function to customize this behavior (e.g. shouldCreateTx: (Fragment) -> Boolean
  • If there's an active Activity transaction, should we keep it or should we replace it with the Fragment one?
    • I think we should keep it and make the fragment integration create a span instead
  • Should inherit most of the behavior from the ActivityLifecycleIntegration, so it would makes sense to commonize that code
    • TTID/TTFD
    • ...
  • ViewPager?
@github-project-automation github-project-automation bot moved this to Needs Discussion in Mobile SDKs Sep 25, 2024
@romtsn romtsn removed the status in Mobile SDKs Sep 25, 2024
@romtsn romtsn moved this to Needs Discussion in Mobile SDKs Sep 25, 2024
@markushi
Copy link
Member

markushi commented Sep 25, 2024

Some more considerations:

  • For ViewPager we could determine if a fragment is visible or not based on the .getGlobalVisibleRect() API
  • If a fragment takes up most of the screen space, it's considered a "screen fragment"
  • Add an option to enable this feature
  • Keep the underlying APIs for generating screen txn generic, so we could use it for the manual screens API

@markushi markushi moved this from Needs Discussion to Backlog in Mobile SDKs Sep 25, 2024
@kahest
Copy link
Member

kahest commented Oct 8, 2024

Just leaving a note here that we had some recent interactions with customers that requested this

@kahest kahest moved this from Backlog to Todo in Mobile SDKs Oct 8, 2024
@stefanosiano
Copy link
Member

Let's also think about a way to split the Activity and Fragments span data in the UI, so that we can have slow/frozen frames separated between Activity and Fragment

@romtsn
Copy link
Member Author

romtsn commented Feb 10, 2025

One thing to consider: We should have a flag that disable Fragment tracing completely (even a new trace generation if perf is disabled), because RN is using Fragments for navigation sometimes, and we may be overriding their trace: #4137 (comment)

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

No branches or pull requests

5 participants