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

Element Call: display error dialog only when loading the main URL #3962

Merged

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Nov 27, 2024

Content

Only propagate 'webview errors' to display the error dialog when the errors happen while trying to load the webview's main URL. At the moment this happened when trying to load any asset or external URL too.

Motivation and context

Fix #3896.

Note this may not work properly on URL redirections, although I hope a redirection means the webview's URL has changed and the check is still valid. In any case, it would be a rare corner case.

Tests

  • Open an Element Call external URL.
  • If it load properly, it's fixed.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

Copy link
Contributor

github-actions bot commented Nov 27, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/2nxE6g

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.06%. Comparing base (5610b19) to head (76f16e1).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...call/impl/utils/WebViewWidgetMessageInterceptor.kt 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3962      +/-   ##
===========================================
- Coverage    83.07%   83.06%   -0.01%     
===========================================
  Files         1791     1791              
  Lines        45348    45351       +3     
  Branches      5350     5353       +3     
===========================================
  Hits         37673    37673              
- Misses        5799     5802       +3     
  Partials      1876     1876              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

OK for the change, but we should probably give more info in the onError lambda and let the presenter decide what to do.

Also there is another call to onError in onReceivedSslError, maybe also protect this call hence I do not think it is necessary to fix the issue.

@jmartinesp jmartinesp force-pushed the fix/webview-error-dialog-on-401-http-status-code branch from 0b3ce8e to 20192eb Compare November 28, 2024 08:29
@jmartinesp jmartinesp changed the title Element Call: only display the error dialog for HTTP errors on the ma… Element Call: display error dialog for HTTP errors only for the main URL Nov 28, 2024
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Nov 28, 2024
@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 28, 2024
@jmartinesp jmartinesp force-pushed the fix/webview-error-dialog-on-401-http-status-code branch from 20192eb to 76f16e1 Compare November 28, 2024 08:34
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 28, 2024
@jmartinesp jmartinesp marked this pull request as ready for review November 28, 2024 08:34
@jmartinesp jmartinesp requested a review from a team as a code owner November 28, 2024 08:34
@jmartinesp jmartinesp requested review from ganfra and removed request for a team and ganfra November 28, 2024 08:34
@jmartinesp jmartinesp changed the title Element Call: display error dialog for HTTP errors only for the main URL Element Call: display error dialog only when loading the main URL Nov 28, 2024
Copy link

sonarcloud bot commented Nov 28, 2024

@jmartinesp jmartinesp merged commit 67be3f0 into develop Nov 28, 2024
23 of 26 checks passed
@jmartinesp jmartinesp deleted the fix/webview-error-dialog-on-401-http-status-code branch November 28, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element Call links cause a "401" error modal and the call does not load
3 participants