-
Notifications
You must be signed in to change notification settings - Fork 1
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
Android performance/state management refactor #557
base: main
Are you sure you want to change the base?
Conversation
6ed300c
to
1eb0111
Compare
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.
Nice! Just a few small testing questions
|
||
coordinate = coordinate2 | ||
composeTestRule.awaitIdle() | ||
assertEquals(NearbyStaticData(globalResponse, NearbyResponse(builder2)), actualNearby) |
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.
question: since builder1 and builder2 both don't have any associated objects, are the assertions on 65 and 69 equivalent?
override fun onCleared() { | ||
super.onCleared() | ||
predictionsRepository.disconnect() | ||
} |
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.
Nice, looks like this takes care of at least part of leave realtime channels when backgrounding! Do we need to do anything else to rejoin the channels when returning like onCreate
? Can be addressed as a follow-up if so!
check(isConnected) { "called disconnect when not connected" } | ||
isConnected = false | ||
launch { disconnectChannel.send(Unit) } | ||
/* null-op */ |
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.
question: Is there still a meaningful alternative way to test that disconnect is called as expected? Could we invoke onCleared
directly in a test?
Summary
Ticket: Address jankiness / lag in UI
What is this PR for?
This PR addresses consistent "jank" (lag, stuttering) in the app due to an overloaded UI thread.
Testing
What testing have you done?
Manual testing for the expected improvements in performance, unit testing for the code changes related to state management.