Android: replies never stream in over a companion (LAN/Tailscale) pairing, only after restarting the app
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- android, typescript
- Ambito
- mobile, networking
Direzione di ricerca
Start with apps/companion/src/proxy.ts and src/mobile/transport/transport.ts, then trace how installTransport opens the event stream and how companion requests check Origin. The issue reports a local native Android streaming plugin as a working fix and notes that the WebSocket viewer needs a similar path or origin handling. Done when companion replies stream to Android without restarting and the live computer view works.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
Paired with the Mac over the companion (both the Wi-Fi and the Tailscale pairing). Sending a message works and the desktop shows it, but the bot's reply never appears on the phone. It only shows after the app is killed and reopened. The live computer view (the display icon) stays blank for what looks like the same reason.
Cause: the companion rejects any request that carries an Origin header before it looks at the token (apps/companion/src/proxy.ts, "A native app sends no Origin"; handle.upgrade does the same for WebSockets). Ordinary requests go through CapacitorHttp (native, no Origin) and work. But installTransport (src/mobile/transport/transport.ts) opens the event stream with the WebView's own fetch (CapacitorWebFetch), and the WebView always sends Origin: https://localhost. So the stream gets 403 {"error":"forbidden: cross-origin request"}. Reproduced with curl:
curl -H "Origin: https://localhost" http://<mac>:8810/api/events -> 403 forbidden: cross-origin request
curl http://<mac>:8810/api/events -> 401 (reaches the token check)
CapacitorHttp can't carry the stream, because it buffers the whole body. What fixed it locally: a small native Android plugin that does the streaming GET with HttpURLConnection and passes chunks to JS as events, plus a fetch-shaped shim that installTransport uses as streamFetch for http: (companion) origins. Replies now stream in live. Happy to open a PR with it if that approach is welcome. The WebSocket viewer would need a similar native path, or the companion would need to accept the app's own origins (https://localhost, capacitor://localhost) with a valid token.
Setup: desktop 0.2.17 on macOS; phone app built from main at 7791c1f (apps/mobile, Android debug build, Samsung Galaxy S26), paired over the companion (port 8810).
Steps to reproduce
- Build
apps/mobilefor Android (allowing cleartext, see the readiness notes) and pair with a Mac over Wi-Fi or Tailscale. - Send a bot a message from the phone.
- The reply appears on the desktop but not on the phone until the app is restarted.
Version
0.2.17 (desktop, macOS); phone app from main @ 7791c1f
Platform
Android
Engine
No response
Logs or screenshots
- Lingua principale
- TypeScript
- Stelle
- 277
- Fork
- 27
- Merge medio
- 2h 47m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DuskBotAI/duskbot
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
After uninstalling an own server, the desktop app stays on it and shows Cloudflare's Error 1033 pageAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
install.sh --tailscale replaces whatever the host already serves on tailnet port 443Forse già presa @viniciusbregoli l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di DuskBotAI/duskbot
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel-labs/ui#865 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
outline/outline#14638 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
wayfinder:grilling
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
patricktree/cup#484 ·
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
midnightntwrk/platform-js#69 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno