UninitializedPropertyAccessException in LessonThumbnailImageView for thumbnailDownloadUrlTemplate #1571
Labels
bug
End user-perceivable behaviors which are not desirable.
good first issue
This item is good for new contributors to make their pull request.
Impact: Low
Low perceived user impact (e.g. edge cases).
Work: Medium
The means to find the solution is clear, but it isn't at good-first-issue level yet.
Z-ibt
Temporary label for Ben to keep track of issues he's triaged.
LessonThumbnailImageView
injects 3-4 different values which works correctly on all screens except one screen, StoryActivity, when there are more than 2-3 items. This has something to do with how the injection works with recyclerview and data binding.One of the reasons that was mentioned is that it might be happening because the bindings are evaluated before the view is attached to window.
Some of the points there were discussed in team meeting are:
Suggest starting with a test to repro the issue in a test environment locally to better understand why the issue happens, then we can reason about the approach to repro the issue & try to fix it more broadly
Should look into bringing up view injection earlier in view lifecycle (e.g. constructor)
If current injection logic doesn't work in the constructor, might be feasible to change view scope to be a child of application instead of fragment which should definitely allow injection in constructors (though this limits our design options for views)
One resource shared by Pulkit is:
google/dagger#720
We should write a test that tries to inflate the view via data-binding & set properties on it before adding the view to an actual layout to render. This can possibly result in crash and based on that we can inspect the exact issue.
The main problem is that we have seen this crash only twice (Rajat + Akshay) and after that we have not been able to replicate it and therefore this needs to be investigated in detail.
The text was updated successfully, but these errors were encountered: