Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

JackVCurtis
Copy link
Contributor

@JackVCurtis JackVCurtis commented Nov 26, 2024

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.

  • If you added any user facing strings on iOS, are they included in Localizable.xcstrings?

Testing

What testing have you done?

Manual testing for the expected improvements in performance, unit testing for the code changes related to state management.

@JackVCurtis JackVCurtis marked this pull request as ready for review December 2, 2024 20:34
@JackVCurtis JackVCurtis requested a review from a team as a code owner December 2, 2024 20:34
Copy link
Collaborator

@KaylaBrady KaylaBrady left a 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)
Copy link
Collaborator

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?

Comment on lines +47 to +50
override fun onCleared() {
super.onCleared()
predictionsRepository.disconnect()
}
Copy link
Collaborator

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!

Comment on lines -65 to +61
check(isConnected) { "called disconnect when not connected" }
isConnected = false
launch { disconnectChannel.send(Unit) }
/* null-op */
Copy link
Collaborator

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?

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