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

Try to mitigate missing relay list errors #5596

Merged
merged 4 commits into from
Jan 19, 2024

Conversation

Pururun
Copy link
Contributor

@Pururun Pururun commented Dec 15, 2023

This PR tries to make situations where a user would see an empty relay list rarer by trying to mitigate some potential sources for this error in the app layer.
The two changes are:

  1. Change from SharingStarted.Eagerly to SharingStarted.WhileSubscribed(). This, according to my tests, delays the call to fetch the relay list by around 400 ms. This in my opinion could make things less likely to break since the call is made later and thus the call (or the answer) is less likely be lost.
  2. Make a call to get the relay list again when entering the SelectLocationScreen. This would mean that if the user still encounters this error it can be resolved when they opening the actual screen. It still would cause them to see an empty list for a second.

This change is Reviewable

Copy link

linear bot commented Dec 15, 2023

@Pururun Pururun added the Android Issues related to Android label Dec 15, 2023
@Pururun Pururun self-assigned this Dec 15, 2023
Copy link
Contributor

@Rawa Rawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 5 files at r1, all commit messages.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @Pururun)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt line 183 at r1 (raw file):

                    }
                    is SelectLocationUiState.ShowData -> {
                        if (uiState.countries.isEmpty() && uiState.searchTerm.isNotEmpty()) {

I'm a bit confused about this one. Is it necessary? I mean if the countries list is Empty we should show the message no matter what right? Is there a case where the search term is empty and we don't have any countries? If so shouldn't it have a completely separate state?

Copy link
Contributor

@Rawa Rawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @Pururun)

Copy link
Contributor Author

@Pururun Pururun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @Rawa)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt line 183 at r1 (raw file):

Previously, Rawa (David Göransson) wrote…

I'm a bit confused about this one. Is it necessary? I mean if the countries list is Empty we should show the message no matter what right? Is there a case where the search term is empty and we don't have any countries? If so shouldn't it have a completely separate state?

This happens when the list we got from the daemon is empty. This currently shows a text that there is no search results for an empty term. But will move this check to the view model.

@Pururun Pururun force-pushed the missing-relay-list-in-location-selection-view-droid-574 branch from f41a2f2 to 97b40cd Compare December 18, 2023 10:42
Copy link
Contributor Author

@Pururun Pururun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 9 files reviewed, 1 unresolved discussion (waiting on @Rawa)


android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt line 183 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

This happens when the list we got from the daemon is empty. This currently shows a text that there is no search results for an empty term. But will move this check to the view model.

Done

@Pururun Pururun force-pushed the missing-relay-list-in-location-selection-view-droid-574 branch from 97b40cd to 73aaa4f Compare January 4, 2024 14:30
@Pururun Pururun force-pushed the missing-relay-list-in-location-selection-view-droid-574 branch 3 times, most recently from 3c521d6 to 16fe40f Compare January 12, 2024 10:08
@albin-mullvad albin-mullvad requested a review from Rawa January 19, 2024 10:24
Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 5 files at r1, 4 of 7 files at r2, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)

@Pururun Pururun force-pushed the missing-relay-list-in-location-selection-view-droid-574 branch from 16fe40f to 90d3be2 Compare January 19, 2024 10:29
Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @Rawa from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Pururun Pururun force-pushed the missing-relay-list-in-location-selection-view-droid-574 branch from 90d3be2 to 7efda2d Compare January 19, 2024 12:31
@Pururun Pururun merged commit e0d794c into main Jan 19, 2024
12 checks passed
@Pururun Pururun deleted the missing-relay-list-in-location-selection-view-droid-574 branch January 19, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants