apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

[Bug]: Enabling dark mode turns the "Webpage not available" page into a black screen

Open ByteBreeze233 opened this issue 3 months ago • 8 comments

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

  1. Tap SIGN UP.
  2. A Webpage not available page is shown with net::ERR_UNKNOWN_URL_SCHEME.
  3. Enable system Dark Mode.
  4. 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

Image Image

Would you like to work on the issue?

None

ByteBreeze233 avatar Aug 25 '26 13:08 ByteBreeze233

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! :-)

nicolas-raoul avatar Aug 25 '26 14:08 nicolas-raoul

I often see this even when I’m connected to the internet, and sometimes the page stays blank for a long time.

ByteBreeze233 avatar Aug 26 '26 07:08 ByteBreeze233

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!

AdityaDarke97 avatar Oct 05 '26 16:10 AdityaDarke97

Hello @nicolas-raoul , @ByteBreeze233 , can i work on this??

EDSONZ-WASSWA avatar Oct 15 '26 08:10 EDSONZ-WASSWA

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.

EDSONZ-WASSWA avatar Oct 19 '26 08:10 EDSONZ-WASSWA

Nice, thanks for the research! 🙂

nicolas-raoul avatar Oct 19 '26 09:10 nicolas-raoul

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:

Image

Any solution to get around it is welcome, Thanks!

EDSONZ-WASSWA avatar Oct 20 '26 19:10 EDSONZ-WASSWA

@EDSONZ-WASSWA Try building the "prodDebug" flavor of the app. Thanks!

nicolas-raoul avatar Oct 21 '26 04:10 nicolas-raoul