Since 1.13.0 where explicit parents were introduced, the lookupService method relies on List<Object> latestState = this.latestState; to reconstruct the scope hierarchy for proper ordering.
However, this actually skips uncleared scopes that are intermittent during navigation.
This can result in an error of not finding services inside views inflated by ViewPagers as the view inflation of these child views is delayed, and doesn't occur immediately when added to the view hierarchy. By the time they are inflated, the "latest state" belongs to the current navigation target -- and while the scope actually exists, the lookup does not find it.
A test case to reproduce this must be added, along with a fallback mechanism -- and it's quite crucial to fix this ASAP.
Since 1.13.0 where explicit parents were introduced, the
lookupService
method relies onList<Object> latestState = this.latestState;
to reconstruct the scope hierarchy for proper ordering.However, this actually skips uncleared scopes that are intermittent during navigation.
This can result in an error of not finding services inside views inflated by ViewPagers as the view inflation of these child views is delayed, and doesn't occur immediately when added to the view hierarchy. By the time they are inflated, the "latest state" belongs to the current navigation target -- and while the scope actually exists, the lookup does not find it.
A test case to reproduce this must be added, along with a fallback mechanism -- and it's quite crucial to fix this ASAP.