-
Notifications
You must be signed in to change notification settings - Fork 60
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
Taps not always associated with the correct fragment #1387
Comments
Hello @GetsEclectic! Thanks for reporting the issue. Indeed actions are always associated with the current active RUM view, and we are making our best effort to find the element which was tapped. As far as I understand from the table you've provided both |
Yes, that's correct. |
In RUM all the actions are living (=linked) in the scope of the view which was started previously, it is not possible to re-link the action to another view (which may be not even reported to RUM). In this particular case where multiple fragments can co-exist on the screen it is hard to say which one is the "the most real" one with automated view tracking strategies, so some manual tuning is needed: you can try to provide the custom predicate with the view tracking strategy to filter out fragments which shouldn't be reported as RUM view. In your particular case I guess Let me know if it works for you. |
I can't just filter out BottomNavContainerFragment unfortunately because it does have 4-5 buttons that can be tapped. It looks like calling findFragment() on the target does a better job of attributing it to the correct fragment. |
Unfortunately we don't have a way to specify view name in the RUM action tracking API, because it may break the core concepts of RUM: for example the view submitted to |
Yeah sounds like it wouldn't be a small change, it might be valuable to be able to supply a 'suggested' fragment which could be overridden? I think it's pretty common that screens contain multiple fragments? |
Looking from the high perspective it is indeed not a simple problem to tackle, simply because of the fragment lifecycle: they can be started in the different order and at the different time. We could provide some predicate supplying the list of fragments detected and asking to provide the active one, but then we have to wait for all fragments to become active, which may skew some performance metrics and bring other problems or inconsistencies. I'll add this problem to the backlog, will see what we can do about it. |
sounds good, thanks! |
Thanks for taking the time for reporting an issue!
Describe what happened
Include any error message or stack trace if available.
I noticed that in the RUM UI, taps are often not associated with the fragment they belong to. I don't see the fragment information being sent for a tap in the sdk, it seems like it might be associated with the most recent 'View Load'? I played around with the code a bit and was able to more reliably determine the correct fragment in handleTapUp like this:
target.findFragment().javaClass.name
Steps to reproduce the issue:
Tap things in the app and then look at RUM
Describe what you expected:
These MaterialCardViews are actually both in InvestHomeFragment:
Additional context
The text was updated successfully, but these errors were encountered: