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

[main] User input for add/edit screen is lost across process death #890

Open
Zhuinden opened this issue Dec 6, 2022 · 0 comments
Open

Comments

@Zhuinden
Copy link

Zhuinden commented Dec 6, 2022

Similarly to older issues that have since been either closed or fixed such as #370 and #123 and #731 and #663

This bug seems to have been long-standing, but with MutableStateFlow(UiState) it still persists - as on this screen, SavedStateHandle is used only for transferring screen arguments to the ViewModel, but is not actually used to preserve user inputs across process death.


On the other hand, TasksViewModel correctly persists the current filter state using savedStateHandle.getStateFlow.

private val _savedFilterType =
savedStateHandle.getStateFlow(TASKS_FILTER_SAVED_STATE_KEY, ALL_TASKS)

Filtering state on the tasks screen was originally fixed by setting it on the SavedStateHandle in this commit: cfb5ac6#diff-631edb6efa01767b52856a0e498dc3987e8a2f0e8ba02837377dfbc5684af0cfR111


Therefore, AddEdit screen should also correctly save/restore user inputs across process death.

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

No branches or pull requests

1 participant