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

UiRequestViewModel is ends silently #36

Open
freelanzer1 opened this issue Aug 21, 2024 · 5 comments
Open

UiRequestViewModel is ends silently #36

freelanzer1 opened this issue Aug 21, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@freelanzer1
Copy link

When the ActivityViewModel is used in the project and it is necessary to perform cleanup using requireActivity().getViewModelStore().clear (), so the UiRequestViewModel terminates silently. Since this ViewModel is created from the library, users are not always aware of its existence, but the entire logic of the library is tied to it. As a result, it is not an obvious and silent bug, which leads to the refusal to all work in the library. The proposed solution is to finalize the library in terms of outputting a message to the log that the UiRequestViewModel has ended (logging to onCleared()) or indicating that after getViewModelStore().clear() it is necessary to recreate the Activity

@freelanzer1
Copy link
Author

Or maybe there is another solution?

@RadiationX
Copy link
Contributor

Thanks for reporting the bug. I'll think about how to fix it.

@RadiationX RadiationX added the bug Something isn't working label Aug 22, 2024
@RadiationX
Copy link
Contributor

@freelanzer1
I think that you can create UiRequestViewModel on new permission requests. And after clearing ViewModelStore recreate UiRequestViewModel.

Looks like a solution to the problem, what do you think, is this solution suitable?

@freelanzer1
Copy link
Author

@RadiationX It sounds good, but if it will be done automatically, inside the library and will not require improvements from library users. Please make changes to the library or describe in the documentation how to work around this problem (with examples)

@RadiationX
Copy link
Contributor

@freelanzer1
Fixed in version 1.1.3. https://github.com/mintrocket/MintPermissions/releases/tag/1.1.3
Nothing extra needs to be done, just update the version.

Please check if everything works correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants