[Bug]: Enabling dark mode turns the "Webpage not available" page into a black screen
Summary
Enabling system Dark Mode on the Webpage not available page after tapping SIGN UP causes the error content to disappear, leaving a completely black screen.
Steps to reproduce
- Tap SIGN UP.
- A Webpage not available page is shown with
net::ERR_UNKNOWN_URL_SCHEME. - Enable system Dark Mode.
- The page becomes completely black.
Expected behaviour
The error page should remain visible and be recreated correctly in dark mode.
Actual behaviour
After enabling dark mode, the error content disappears and only a black screen is shown.
Device name
No response
Android version
Android 15
Commons app version
6.6.0
Device logs
No response
Screenshots
Would you like to work on the issue?
None
Are there conditions (for instance no internet), or does Webpage not available page always appear when tapping SIGN UP? That would be an issue too.
Thanks a lot for your reports! :-)
I often see this even when I’m connected to the internet, and sometimes the page stays blank for a long time.
While I'd like to work on this issue, the error shown in this case is a UNKNOWN URL SCHEME error, which is caused when the system is unable to recognize the URL and fetch it into the app's webview. The url shown in the screenshot is an intent:// url, which I couldn't find in the entire app (v6.7.0), So I couldn't reproduce the issue. Can you provide with more details, such as logcat output?
Thanks!
Hello @nicolas-raoul , @ByteBreeze233 , can i work on this??
hello @nicolas-raoul , @ByteBreeze233 , I have studyied this bug and I have figured out that the when the webview shows the default error page, and hen the user switches to dark mode, the BaseActivity recreates the activity to apply to the new theme, but here is the catch, the Webview error page state does not get properly preserved through the recreation and so it ends up rendering the black screen. This is because the SignupActivity doesnt implement the onsaveInstanceState for the webview, so when its gets recreated during theme change, the error page is is lost,
So the fix to me is to make the error page theme aware by using the apps actual theme colors, then properly save and restore the error sate when activity recreates, use androidx.webkit to control the webviews dark mode behavior instaed of relying on the default error page. Coz this will give us consistent error page in both light and dark themes.
Nice, thanks for the research! 🙂
hello @nicolas-raoul , I have tried to reproduce the bug, but looks like when i tap the signup, I get blocked as shown in the image below:
Any solution to get around it is welcome, Thanks!
@EDSONZ-WASSWA Try building the "prodDebug" flavor of the app. Thanks!