-
Notifications
You must be signed in to change notification settings - Fork 992
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
refresh-user #224
Merged
Merged
refresh-user #224
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5a4f144
Refreshing the user on app resumes.
eoji 3d044ee
:sweat_smile:
eoji 1b795e6
Lots of changes!
eoji f9857d6
cleaning up the lint
eoji e40626c
remove log
eoji baa95f1
Adding a comment to help clarify what `userHasChanged` does
eoji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hey as far as I can tell (but I might be missing something in the Java) is that
this.currentUser.refresh()
will just refresh with whatever is passed to it. So I think this will just take thecurrentUser
and "refresh" it again. At which point do we make a new call to the API to fetch a fresh user?Also, in this particular scenario it might not even be necessary to use RxJava because we're just imperatively lifting the token into FRP land in order to
subscribe
to it (with the user) and then to refresh the user with the user 🤔I think I might need a little more insight into how the lifecycle stuff works in Android but maybe we should pair on this 💪
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.
😅 look for my calendar invite!
I changed this line! Which is where we get a fresh user 🙏 https://github.com/kickstarter/android-oss/pull/224/files#diff-40963cc3fde7a9c5d143820bc2075139R65
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.
Aah got it! I missed the fetch part of that 😄
Then actually this is probably fine but couldn't it just be:
Think that just removes the need to lift the accessToken into RxJava and to zip it with the new user.