-
Notifications
You must be signed in to change notification settings - Fork 511
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
Fix #1572: Story Activity orientation change bug #1664
Fix #1572: Story Activity orientation change bug #1664
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does work. But the main issue is that why do we need this setRetainInstance
in this fragment and not in other fragments.
Exploration
can be started from three places:
RecentlyPlayed
-> In this we don't needsetRetainInstance
TopicLessons
-> In this we don't needsetRetainInstance
StoryFragment
-> In this if you remove thissetRetainInstance
and investigate you will notice thatclick
is working but the domain layer of exploration is not able to send back the result correctly to app layer.
So, although you solution works but it does not solve the issues which is in domain layer.
What i found here is the data which is coming from controller, we are observing it, and for this we are using fragment instance. |
@anandwana001 this PR is lacking detail on what you've tried, and what is specifically broken. If there's an issue with bindable adapter, what is that issue? We should make sure that we fully understand the causes behind the underlying bug, and fix those. |
@BenHenning Firstly, What I remember is We are observing the data inside a ViewModel, which I think should happen in a fragment presenter, as it is happening for all other data observing our codebase. Without the fix, I had taken log of the fragment:
print Internal unique name for this fragment - format <FragmentName{identityHashCode} (UUID) id=0x>
Logging the context of fragment
If we see for
|
Similar issue - #1676 |
Thanks @anandwana001. As discussed during the meeting, we have two different approaches that we can take:
I suggest trying approach (2) for these two issues to see if it resolves the problem. Hopefully that's a bit simpler. Also, please make sure to add tests for this case as well. I'd expect it to be reproable with a test that triggers a configuration change. |
Sure, I will definitely keep in mind about the test cases point from now. Thanks. |
… story-activity-orientation-change-click # Conflicts: # app/src/main/java/org/oppia/app/story/StoryViewModel.kt
… story-activity-orientation-change-click # Conflicts: # .idea/vcs.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other PR. This does work but will need to defer to @BenHenning about the approach.
Thanks for having a look at this, might my save time to complete this asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anandwana001 can you include the details of the failure that the test catches (e.g. what exactly is failing) in the case where the fix isn't present? That's helpful to ensure the test is catching the same issue.
Otherwise, this LGTM!
… story-activity-orientation-change-click
Explanation
Fix #1572
Test passes with fix
Test fail without fix
Checklist