Skip to content

[WIP] Fix WebUI not opening due to silent failure#46

Closed
Copilot wants to merge 1 commit intoDeffrom
copilot/fix-webui-silent-failure
Closed

[WIP] Fix WebUI not opening due to silent failure#46
Copilot wants to merge 1 commit intoDeffrom
copilot/fix-webui-silent-failure

Conversation

Copy link

Copilot AI commented Mar 9, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Fix WebUI not opening (silent failure on ACTION_VIEW Intent)

Description:
The application attempts to start a local WebUI and open it in the default browser, but it fails silently. No browser is opened, and no exceptions/crash logs are printed. The last visible console log is:
- Opening WebUI at http://localhost:5623/?token=[TOKEN]
Starting: Intent { act=android.intent.action.VIEW dat=http://localhost:5623/... }

Tasks & Requirements:

  1. Fix Intent Flags: Inspect the code where android.intent.action.VIEW is triggered. If startActivity(intent) is called from outside an Activity context (e.g., Service, BroadcastReceiver), you must add Intent.FLAG_ACTIVITY_NEW_TASK to the intent.
  2. Add Error Handling: Wrap the startActivity(intent) call in a try-catch block. Catch ActivityNotFoundException (if no browser is installed) and generic Exception. Log these errors explicitly using Log.e.
  3. Verify Server Readiness: Ensure the local web server (localhost:5623) is fully started and actively listening before the Intent is fired. Add a callback or wait mechanism if the server startup is asynchronous to prevent premature intent firing.
  4. Enhance Debug Logging: Add verbose Log.d statements during the server startup phases, port binding, and right before the Intent is fired to track down the exact point of the silent failure.
  5. Network Security Config: Check the Android network security configuration. Ensure that cleartext traffic (http://) is permitted for localhost. Add the necessary domain configuration if it is missing.

You'll also find that actions include tests even for these kinds of specific things. Or you'll have to add more. Add live tests to the emulators for everything. Don't leave anything out; think like an expert engineer.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants