-
Notifications
You must be signed in to change notification settings - Fork 349
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
Add konsist vm checks #5212
Add konsist vm checks #5212
Conversation
67daee9
to
8c458bf
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.
Reviewed 32 of 33 files at r1, all commit messages.
Reviewable status: 32 of 33 files reviewed, 4 unresolved discussions (waiting on @albin-mullvad)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 40 at r1 (raw file):
private val _toastMessages = MutableSharedFlow<String>(extraBufferCapacity = 1) @Suppress("konsist.ensurePublicPropertiesUsePermittedNames")
I guess the long term solution to this would be to fold toast messages into side effects? Otherwise I guess it should be permitted. Or I guess it will be fixed by going to full compose?
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 43 at r1 (raw file):
val toastMessages = _toastMessages.asSharedFlow() @Suppress("konsist.ensurePublicPropertiesUsePermittedNames") var accountToken: String? = null
Maybe we should create an issue to improve this behaviour? So that we don't just add a suppress and forget about it.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModel.kt
line 69 at r1 (raw file):
) @Suppress("konsist.ensurePublicPropertiesUsePermittedNames")
This should be a uiSideEffect
. I guess either we should create a linear issue or include this change in this PR.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
line 54 at r1 (raw file):
private val _toastMessages = MutableSharedFlow<String>(extraBufferCapacity = 1) @Suppress("konsist.ensurePublicPropertiesUsePermittedNames")
See comment above.
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.
Reviewable status: 32 of 33 files reviewed, 4 unresolved discussions (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 40 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
I guess the long term solution to this would be to fold toast messages into side effects? Otherwise I guess it should be permitted. Or I guess it will be fixed by going to full compose?
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 43 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
Maybe we should create an issue to improve this behaviour? So that we don't just add a suppress and forget about it.
Good point! New issue: https://linear.app/mullvad/issue/DROID-387/avoid-exposing-account-token-in-device-list-view-model
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModel.kt
line 69 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
This should be a
uiSideEffect
. I guess either we should create a linear issue or include this change in this PR.
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
line 54 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
See comment above.
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
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.
Reviewed 1 of 33 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 40 at r1 (raw file):
Previously, albin-mullvad wrote…
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
🙌
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt
line 43 at r1 (raw file):
Previously, albin-mullvad wrote…
Good point! New issue: https://linear.app/mullvad/issue/DROID-387/avoid-exposing-account-token-in-device-list-view-model
🙌
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModel.kt
line 69 at r1 (raw file):
Previously, albin-mullvad wrote…
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
🙌
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
line 54 at r1 (raw file):
Previously, albin-mullvad wrote…
Yes! https://linear.app/mullvad/issue/DROID-388/use-side-effects-for-all-one-shot-ui-updates
🙌
8c458bf
to
8af8d3c
Compare
This PR aims to add some Konsist checks for our view models.
This change is