-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: Custom server no network dialog #WPB-11627 #3543
base: develop
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
@@ -122,7 +125,8 @@ class WireActivityViewModel @Inject constructor( | |||
private val observeScreenshotCensoringConfigUseCaseProviderFactory: ObserveScreenshotCensoringConfigUseCaseProvider.Factory, | |||
private val globalDataStore: Lazy<GlobalDataStore>, | |||
private val observeIfE2EIRequiredDuringLoginUseCaseProviderFactory: ObserveIfE2EIRequiredDuringLoginUseCaseProvider.Factory, | |||
private val workManager: Lazy<WorkManager> | |||
private val workManager: Lazy<WorkManager>, | |||
private val networkStateObserver: Lazy<NetworkStateObserver> |
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.
this is over kill you don't need to check the network state, we can do the request to get the json with custom server meta data and check the error returned it is a network error with something list Io Exception then display this error
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.
That is unfortunately not doable:
-
When we dont have internet connection and the config is valid we're getting:
GenericError(cause=java.net.UnknownHostException: Unable to resolve host "nginz-https.bund-next-column-offline-android.wire.link": No address associated with hostname)
-
When we have internet connection and the config is invalid we're getting:
GenericError(cause=java.net.UnknownHostException: Unable to resolve host "nginz-https.unreachable.wire.link": No address associated with hostname)
So we're unable to know if the config was wrong or not with the exception we're getting
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.
Maybe we could slightly change the copy and use this dialog in both cases?
Like: "You don't seem to be connected to the Internet or the config link you used is broken. Please check your Internet connection and try again." 😄
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.
Well yeah we could have only one for malformed json and no internet connection :D that'd solve the issue too
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.
When we dont have internet connection and the config is valid we're getting:
GenericError(cause=java.net.UnknownHostException: Unable to resolve host "nginz-https.bund-next-column-offline-android.wire.link": No address associated with hostname)
I feel like i am missing something?
this will never happen how was the app able to know that the constant is valid if we are not able to read the content, since there is no internet?
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.
Changes pushed as we talked today, we now have the no network
message for both cases ;)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3543 +/- ##
========================================
Coverage 45.77% 45.77%
========================================
Files 472 472
Lines 16024 16025 +1
Branches 2705 2705
========================================
+ Hits 7335 7336 +1
Misses 7928 7928
Partials 761 761
Continue to review full report in Codecov by Sentry.
|
Built wire-android-staging-compat-pr-3543.apk is available for download |
Built wire-android-dev-debug-pr-3543.apk is available for download |
Quality Gate passedIssues Measures |
Built wire-android-staging-compat-pr-3543.apk is available for download |
Built wire-android-dev-debug-pr-3543.apk is available for download |
https://wearezeta.atlassian.net/browse/WPB-11627
What's new in this PR?
Issues
When we're trying to connect with custom server and we didnt have internet connection, we didnt display correct popup
Solutions
Due to the matter of handling invalid json being exactly the same as no network, we have to check on our own if we're connected to internet or not. Depending on that we display no network dialog.
Testing
How to Test
Attachments (Optional)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.