-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Don't use AccountSettings on main thread #1049
Merged
rfc2822
merged 5 commits into
main-ose
from
1047-accountssettings-is-used-from-main-thread
Oct 3, 2024
Merged
Don't use AccountSettings on main thread #1049
rfc2822
merged 5 commits into
main-ose
from
1047-accountssettings-is-used-from-main-thread
Oct 3, 2024
Conversation
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
2 tasks
sunkup
force-pushed
the
1047-accountssettings-is-used-from-main-thread
branch
2 times, most recently
from
October 1, 2024 10:17
ed2a6d5
to
711c603
Compare
rfc2822
reviewed
Oct 1, 2024
app/src/main/kotlin/at/bitfire/davdroid/settings/AccountSettings.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/ui/account/AccountSettingsModel.kt
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/ui/account/AccountSettingsModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/ui/account/AccountSettingsModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/ui/account/AccountSettingsModel.kt
Outdated
Show resolved
Hide resolved
sunkup
force-pushed
the
1047-accountssettings-is-used-from-main-thread
branch
2 times, most recently
from
October 2, 2024 09:24
1384232
to
e6233a7
Compare
rfc2822
reviewed
Oct 2, 2024
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, only #1049 (comment) please as you had it before. Then I'll merge.
sunkup
force-pushed
the
1047-accountssettings-is-used-from-main-thread
branch
2 times, most recently
from
October 3, 2024 09:33
824ee57
to
24c9609
Compare
sunkup
force-pushed
the
1047-accountssettings-is-used-from-main-thread
branch
from
October 3, 2024 09:34
24c9609
to
a3a856e
Compare
rfc2822
approved these changes
Oct 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
AccountSettings uses blocking I/O and may run migrations. We don't want to block the main thread like that, which is why this PR will stop creating/using AccountSettings on the main thread.
Short description
AccountSettingsModel
: Switch to state flow, since snapshot was complicated and didn't work well for me on the background thread ...AccountScreenModel
DebugInfoModel
Resources
https://developer.android.com/topic/architecture/ui-layer/state-production#mutating_the_ui_state_from_background_threads
Checklist