apache / apache/cordova-android
[Feature Request]: Improve error feedback to webview from native
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 1.6k
- Avg merge
- 16h 18m
- Merged PRs (30d)
- 11
Description
# Bug Report
After upgrading to Cordova Android 10.1.1 the login stopped working in release mode. The login being a call to a remote API on https that returns a Set-Cookie header.
## Problem
First of all, the very same call to the very same API in debug deployment works perfectly
After days of trial and error, first of all trying to attach to a release deployment with an inspector to see the console warning, that finally didn't help at all we found out that the problem was caused by a SSL error (still don't know what it is) that was handled differently in debug mode
### What is expected to happen?
To work in both release and debug mode the same
## Information
SystemWebViewClient onReceivedSslError method treats the SSL errors differently in debug mode and makes calls being handled differently
### Command or Code
Our temporary solution was to always call handler.proceed()
`if (true || (appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// debug = true
handler.proceed();
return;
} else {
// debug = false
super.onReceivedSslError(view, handler, error);
}`
### Environment, Platform, Device
Cordova Android 10.1.1
### Version information
Cordova CLI 11
Windows
Android Studio Chipmunk
## Checklist
- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above
Contributor guide
Research direction
Start with SystemWebViewClient.onReceivedSslError and reproduce the HTTPS login request with its Set-Cookie response under Cordova Android 10.1.1 in debug and release builds. Compare the native SSL-error handling and determine what error feedback is expected in the webview; done means the behavior is consistent in both modes without unconditionally calling handler.proceed().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100