You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what happened
Fragments loaded by viewpager are created when visiting adjacents fragments but if you specify the flag BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENTonResume() is not triggered until the fragment is actually visible to the user.
The above behavior is triggering viewLoadingTimer.onCreated() on all the adjacents fragments created, but because onResume() is not called until fragment is visible, the loadingTime is invalid giving bigger values than the real loadingTime.
Steps to reproduce the issue:
Create a viewpager and introduce 4 fragments
Set an adapter on viewpager with BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT flag.
Navigate to fragment 2.
Check fragment 3 is created but onResume() is not called
After a while, navigate to fragment 3 and check onFragmentResumed is triggered and therefore measuring the loadingTime at this point, making it a bigger value than it should be.
Describe what you expected:
ViewLoadingTime should be stopped temporally if fragments belong to viewpager and are not visible to the user.
Albertoperezs90
changed the title
Viewpager adjacent fragments has invalid loadingTime
Viewpager adjacent fragments have invalid loadingTime
Feb 22, 2023
Hello @Albertoperezs90. Thanks for opening the issue. Indeed, loading time reporting may be not correct because of the delayed lifecycle calls as you've described.
We will try to look at this and see how we can improve reporting.
Describe what happened
Fragments loaded by viewpager are created when visiting adjacents fragments but if you specify the flag
BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
onResume()
is not triggered until the fragment is actually visible to the user.The above behavior is triggering
viewLoadingTimer.onCreated()
on all the adjacents fragments created, but becauseonResume()
is not called until fragment is visible, the loadingTime is invalid giving bigger values than the real loadingTime.Steps to reproduce the issue:
BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
flag.onResume()
is not calledonFragmentResumed
is triggered and therefore measuring the loadingTime at this point, making it a bigger value than it should be.Describe what you expected:
ViewLoadingTime
should be stopped temporally if fragments belong to viewpager and are not visible to the user.Additional context
com.datadoghq:dd-sdk-android:1.14.0
com.datadoghq:dd-sdk-android-gradle-plugin:1.5.1
The text was updated successfully, but these errors were encountered: