-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix rotation bugs #1208
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 rotation bugs #1208
Conversation
Signed-off-by: Alex Saveau <[email protected]>
Signed-off-by: Alex Saveau <[email protected]>
Signed-off-by: Alex Saveau <[email protected]>
Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX this will be the final |
# Conflicts: # auth/src/main/java/com/firebase/ui/auth/viewmodel/ResourceObserver.java
For sure, I just wanted to get these PRs into the wild. 😁 |
@@ -55,7 +55,7 @@ public void onChanged(@Nullable Resource<Void> resource) { | |||
return; | |||
} | |||
|
|||
onSaveOperation(resource); |
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.
- Why is
ResourceObserver
not good for this situation? - Having a usable
Resource<Void>
is kind of strange ... but maybe I should just get over it.
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.
That was you! 😆 Nah, I think we weren't doing it because we didn't want to show a loading dialog, but now that I'm looking at the code, we do have a task running in the background so we should be showing one. 🤷♂️, I'll use the ResourceObserver
😄.
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.
Huh, the void thing is kinda ugly: it messed with our nullability annotations. Not sure how to fix it though without getting rid of the Resource
for this altogether.
Signed-off-by: Alex Saveau <[email protected]>
|
Built on top of #1207
Darn it! I should have seen this coming, but the usable failure stuff doesn't cover success states or non-usable failure states! 🤦♂️
TLDR: I just made
Resource
immutable again and added back theisUsed
method which is now checked only once in theResourceObserver
. The main beef you had with that method was that we were checking it everytime, right? Now we aren't. 😁