Mobile: persistent mobile token + revoke control for hands-free PWA reconnect
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- electron, typescript
- 領域
- authentication, desktop, mobile
調査の方向性
Start in electron/remote/server.ts where the mobile token is minted with randomBytes on each start; persist and reuse that token (userData or src/store persistence / src/store/types.ts) and pass it from electron/ipc/register.ts into startRemoteServer. Add a regenerate/disconnect control in src/components/ConnectPhoneModal.tsx wired through src/store/remote.ts so rotation drops existing mobile WS clients. Keep coordinator/subtask tokens per-session. Done when autoStartRemoteAccess keeps the token across desktop restarts, an installed PWA reconnects without re-scan, revoke is one click, and round-trip plus revoke are covered by tests. Document the longer-lived token tradeoff in the UI and/or PRIVACY.md.
索引モデルが issue の本文から書いたものです。
説明
Summary
Make the mobile token survive desktop restarts and add a way to revoke it, so an installed PWA reconnects hands-free instead of forcing a re-scan after every restart.
This is follow-up step 4 of 5 from the "autoconnect to mobile + installable PWA" work. Steps 1–3 have landed:
- Desktop auto-starts the remote server on launch (
autoStartRemoteAccesssetting). - The mobile app ships a PWA manifest + icons (iOS add-to-home-screen works).
- The mobile app has a "Not connected" reconnect screen (paste connection URL / re-pair).
Problem
The mobile token is minted fresh on every server start:
// electron/remote/server.ts
const mobileToken = randomBytes(24).toString('base64url');
So after the desktop restarts, an installed PWA's stored token is invalid. The phone's WebSocket gets rejected (4001), the token is cleared, and the user must re-pair via the reconnect screen. That undermines the whole point of an installed PWA + autoconnect: it should "just work" on relaunch.
Proposed solution
- Persist the mobile token on the desktop (e.g. in
userData, or the persisted app state) and reuse it on each server start instead of always minting a new one. The coordinator/subtask tokens can stay per-session — only the mobile token needs to be stable. - Add a "Regenerate / disconnect devices" control in
ConnectPhoneModalthat rotates the stored mobile token, immediately invalidating any previously paired phone. This is the revoke path. - Optionally rotate automatically if the user explicitly "Disconnects".
Security considerations
A persistent token is a longer-lived bearer credential. This is judged acceptable but should be bounded:
- The remote server is LAN / Tailscale only — never internet-exposed.
- The mobile token is least-privilege: read agents +
input/subscribeover WS, noresize/kill(server.ts). - It must be revocable in one click (the regenerate control above).
Document the tradeoff in the UI ("Experimental") and/or PRIVACY.md.
Acceptance criteria
- Mobile token persists across desktop restarts when
autoStartRemoteAccessis on. - An installed PWA reconnects after a desktop restart with no re-scan (same origin reachable).
- A "Regenerate / disconnect devices" action rotates the token and drops existing mobile WS clients.
- Coordinator/subtask tokens remain per-session.
- Round-trip + revoke covered by tests.
Touch points
electron/remote/server.ts— token minting / accept a supplied mobile token.electron/ipc/register.ts— pass the persisted token intostartRemoteServer; IPC for regenerate.src/store/remote.ts,src/components/ConnectPhoneModal.tsx— revoke UI + store glue.- Persisted state (
src/store/types.ts,persistence.ts) or a dedicateduserDatafile for the token.
Note on origin stability
A persistent token only helps when the PWA's origin is reachable. The desktop LAN IP can change (DHCP) and the port should stay fixed (7777). Tailscale gives a stable IP across networks/restarts and is the most reliable transport for an installed PWA — see step 5.
- 主要言語
- TypeScript
- スター
- 1k
- フォーク
- 144
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 28
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
johannesjo/parallel-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
johannesjo/parallel-code#385 ·
メンテナーはふだん 4 日以内に返信
-
Option to show usage as used instead of left, and potential further customization ideas対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
johannesjo/parallel-code#353 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
johannesjo/parallel-code#163 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
johannesjo/parallel-code#375 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
Package as a Platpakオープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
johannesjo/parallel-code#374 ·
メンテナーはふだん 4 日以内に返信
johannesjo/parallel-code の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
ci
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ClickHouse/clickhouse-js#1248 ·
メンテナーはふだん 1 日以内に返信
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechseltオープンtechnik
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AhmedNAgy25/analysor#25 ·
メンテナーはふだん 1 日以内に返信