-
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
Device list resets after going to settings #5128
Device list resets after going to settings #5128
Conversation
DROID-194 Device list resets after going to settings
After clicking on settings and then going back to the too many devices screen the list is reset as it was when it was first opened, regardless if the user have removed any devices. Steps to reproduce:
|
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 3 of 3 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
.map { if (it is DeviceListEvent.Available) { cachedDeviceList.value = DeviceList.Available(it.devices)
I believe this fix is fine for now but we should probably revisit/reimagine how the DeviceRepository works, it feels unnaturally complex with multiple streams containing deviceList, deviceState, deviceRemovalEvent etc.
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
.map { if (it is DeviceListEvent.Available) { cachedDeviceList.value = DeviceList.Available(it.devices)
This is probably find, but did you test various cases to check whether this cache works as expected? For instance to make sure that the cache never is used in the wrong situation, e.g. if the user tries to log in to another account (and an updated device list fails to be fetched).
Code quote:
cachedDeviceList.value = DeviceList.Available(it.devices)
4d9b115
to
0a5236d
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, albin-mullvad wrote…
This is probably find, but did you test various cases to check whether this cache works as expected? For instance to make sure that the cache never is used in the wrong situation, e.g. if the user tries to log in to another account (and an updated device list fails to be fetched).
probably fine*
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: all files reviewed, 1 unresolved discussion (waiting on @albin-mullvad)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
I believe this fix is fine for now but we should probably revisit/reimagine how the DeviceRepository works, it feels unnaturally complex with multiple streams containing deviceList, deviceState, deviceRemovalEvent etc.
Yes agree, very unnecessarily complex.
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, albin-mullvad wrote…
probably fine*
I have tested logging in to a different account, but not where an updated list fails to fetch.
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: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
I have tested logging in to a different account, but not where an updated list fails to fetch.
Can that scenario also be tested either manually or/and using automated tests? Otherwise this one looks ready to merge.
0a5236d
to
6a51ebc
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.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @albin-mullvad and @Rawa)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, albin-mullvad wrote…
Can that scenario also be tested either manually or/and using automated tests? Otherwise this one looks ready to merge.
Tested it manually and it seems to work fine in that scenario. I think we can merge.
6a51ebc
to
44774e0
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 1 of 2 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt
line 60 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
Tested it manually and it seems to work fine in that scenario. I think we can merge.
Great! 🚀
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: complete! all files reviewed, all discussions resolved
44774e0
to
fef7d02
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.
Reviewable status: complete! all files reviewed, all discussions resolved
This is because the device list is not updated unless specifically told so.
Added so that it always updates on successful device list events.
Also improved the compose view.
This change is