Android: replies never stream in over a companion (LAN/Tailscale) pairing, only after restarting the app
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, typescript
- 領域
- mobile, networking
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 277
- フォーク
- 27
- 平均マージ
- 2時間 47分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DuskBotAI/duskbot のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
After uninstalling an own server, the desktop app stays on it and shows Cloudflare's Error 1033 pageオープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
install.sh --tailscale replaces whatever the host already serves on tailnet port 443対応中かも @viniciusbregoli が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
DuskBotAI/duskbot の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/ui#865 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
outline/outline#14638 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wayfinder:grilling
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
patricktree/cup#484 ·
-
bot:ai-assisted component:platform-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
midnightntwrk/platform-js#69 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信