Skip to content

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

Merged
merged 6 commits into from
Mar 26, 2018
Merged

Fix rotation bugs #1208

merged 6 commits into from
Mar 26, 2018

Conversation

SUPERCILEX
Copy link
Collaborator

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 the isUsed method which is now checked only once in the ResourceObserver. The main beef you had with that method was that we were checking it everytime, right? Now we aren't. 😁

Signed-off-by: Alex Saveau <[email protected]>
Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX SUPERCILEX requested a review from samtstern as a code owner March 25, 2018 05:21
@samtstern samtstern added this to the 3.3.0 milestone Mar 26, 2018
@samtstern
Copy link
Contributor

@SUPERCILEX this will be the final 3.3.0 PR after merge conflicts are resolved.

# Conflicts:
#	auth/src/main/java/com/firebase/ui/auth/viewmodel/ResourceObserver.java
@SUPERCILEX
Copy link
Collaborator Author

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);
Copy link
Contributor

@samtstern samtstern Mar 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why is ResourceObserver not good for this situation?
  2. Having a usable Resource<Void> is kind of strange ... but maybe I should just get over it.

Copy link
Collaborator Author

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 😄.

Copy link
Collaborator Author

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.

@samtstern
Copy link
Contributor

VoidResourceObserver is a good compromise for now. If we start using that all over the place we can reconsider.

@samtstern samtstern merged commit 3ee1155 into firebase:version-3.3.0-dev Mar 26, 2018
@SUPERCILEX SUPERCILEX deleted the rotate branch March 26, 2018 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants