refactor(database): migrate to paging 3 by thatfiredev · Pull Request #1983 · firebase/FirebaseUI-Android

Copy link

Contributor

Choose a reason for hiding this comment

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

I think this will throw if the Tasks fails:
https://developers.google.com/android/reference/com/google/android/gms/tasks/Tasks#await(com.google.android.gms.tasks.Task%3CTResult%3E)

So we can't rely on getting to the next line. Although I think it's fine since you re-throw at the bottom, but I just don't think you'll ever get that far.

Also we can probably remove the task.isSuccessful nesting since we know if we even get to the next line, the task is successful.

Copy link

Member Author

Choose a reason for hiding this comment

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

@samtstern Interesting, I didn't know that.

I have wrapped it around a try/catch so that developers using FirebaseUI can get the original cause instead of await's ExecutionException.