You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: onError() implementation is deficientΒ #3289
and unlike the new version of the method the old one is fired for the main resource errors only β you get the error only if it failed to load the URI passed into the source itself, if it failed to load assets it depends upon (like JS scripts, CSS sheets, and other stuff required by the main resource) you won't get any error, even if it breaks the page and deserves an attempt to reload the page, or some other error-handling in your host app.
P.S.: As this is one is a sensitive problem for myself, I'll fix it and create PR shortly. If anybody is willing to say thanks for that, I am accepting donations via GitHub.Sponsors π
Hmm... having looked around a bit more, I see that onHttpError implementation actually actively ignores errors for assets loading... which is kind of inconsistent with what I want to do with onError :(
Another inconsistency is with the current logic assuming that onLoadEnd should be fired prior to onError; while if I do fire onError for each asset may fail to load for the main resource, it makes sense to emit onError for each failing asset, and then onLoadEnd after it.
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Activity
birdofpreyru commentedon Jan 15, 2024
Hmm... having looked around a bit more, I see that
onHttpErrorimplementation actually actively ignores errors for assets loading... which is kind of inconsistent with what I want to do withonError:(react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java
Lines 247 to 263 in 6960a19
Another inconsistency is with the current logic assuming that
onLoadEndshould be fired prior toonError; while if I do fireonErrorfor each asset may fail to load for the main resource, it makes sense to emitonErrorfor each failing asset, and thenonLoadEndafter it.birdofpreyru commentedon Jan 15, 2024
I guess, my suggestion is to:
onErrorfor each asset that failed to load during the main page loading.onLoadEndonce entire page finished all loading operations (thus, possibly after multiple previous errors).onLoadonly if no errors have been encountered during the page loading for the page itself, nor assets it attempts to load.[react-native-webview#3289] Android: Trigger `onError` callback on asβ¦
github-actions commentedon Mar 16, 2024
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
birdofpreyru commentedon Mar 16, 2024
The issue is not stale, the PR still waits to be merged.
github-actions commentedon May 17, 2024
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
birdofpreyru commentedon May 17, 2024
Yes, bot, the issue is still here, as maintainers still have not merged the PR fixing it.
In the meantime, the issue has been long fixed in my fork of RN WebView, which is a few steps ahead of the upstream library π
github-actions commentedon Jul 17, 2024
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically