Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: Large workspace causes permanent server reconnect loop when a remote client subscribes

オープン
#198 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
macos

調査の方向性

Issue にはソースファイルやテストの指定がありません。まずサーバーの workspace サブスクリプションの経路と relay の状態転送を追跡し、次に、socket の動作と logging を確認しながら、説明されている大きい workspace と小さい workspace で再現します。完了条件は、大量の履歴を持つサブスクリプションが接続されたままになること、または pagination や lazy loading が実装されていない場合に、失敗が明確に記録されることです。

索引モデルが issue の本文から書いたものです。

説明

Platform

macOS

Operating system version

macOS Tahoe 26.5.2 (25F84)

System architecture

ARM64 (M1, M2, etc)

PolyScope Version

0.24.1

Bug description

On a Mac mini running as an always-on server, one specific workspace makes the
server's relay connection collapse into a permanent reconnect loop as soon as a
remote client subscribes to it. Other workspaces on the same server are fine.
It happens both from the desktop app and from the mobile web client.

The workspace that fails has a far larger history:

Workspace messages MB (messages.content) sessions
workspace-a 15,363 40.3 40
workspace-b 262 0.6 3
workspace-c 0 – 0

workspace-a alone is 40.3 MB of a 48 MB polyscope.db, and 40.3 of the
41.1 MB of message content stored in the whole database.

It is not one oversized payload: the largest single message is 110 KB and the
mean is 2.7 KB. messages.metadata is negligible too (0.7 MB across the entire
database), so those figures account for essentially all of the stored state.
It looks like the cumulative volume pushed to the client on subscribe.

Nothing is logged on either machine. The only lines in main.log are
[updater] No update available.

Context: workspace-a had a long-running Autopilot goal going for two days.
When the Claude session limit is hit the SDK fires a burst of retries
(~23 messages), each opening a session — hence 40 sessions. So the history
inflates over time and the problem gets progressively worse.

Steps to reproduce
  1. Have a server with one large-history workspace and one small one.
  2. From a remote client on a different network (desktop app or mobile web), open
    the large workspace.
  3. On the server, watch the outbound relay socket:
    lsof -nP -iTCP -sTCP:ESTABLISHED | grep -i polyscope | grep -v 127.0.0.1
  4. Switch the client to the small workspace and watch again.
Observed

With a client subscribed to the large workspace, the server's relay socket never
survives ~5 s — new fd, new source port, new handle on every sample, with gaps
where no connection exists at all. Reconnect bursts fire three simultaneous SYNs
to the three getpolyscope.com Cloudflare addresses every 8–12 s.

tcpdump shows each attempt completing the TLS handshake, transferring roughly
50–85 KB, then closing — consistent with a state transfer that never finishes.

Switching the client to the small workspace stabilises the socket immediately:
same handle and source port held for minutes. Switching back breaks it again
within seconds. Reproduced several times in both directions.

Reproduced from the desktop app and from the mobile web client.

The server process itself is healthy throughout: 3 d 06 h uptime, no crash
reports, 1.1 GB of 24 GB RAM, zero swap.

Expected

A workspace with a long history should stay reachable remotely — ideally by
paginating or lazily loading history instead of pushing the whole thing on
subscribe. At minimum the failure should be logged instead of surfacing as an
intermittent "Disconnected" with nothing in main.log.

Ruled out
  • Process health: uptime, memory and swap all normal (above).
  • macOS App Nap and power management (pmset fully configured for always-on).
  • Network topology / double NAT.
  • Tailscale: identical behaviour with it disconnected, and tcpdump shows relay
    traffic leaving via the LAN address straight to Cloudflare, never via 100.x.
  • Duplicated server identity: serverId and serverIdentity in
    ~/.polyscope/settings.json differ between the two machines.
  • Oversized individual message or metadata: max 110 KB, mean 2.7 KB, metadata
    0.7 MB total.
  • Client-specific issue: reproduced from two different clients.
Relevant log output

主要言語
言語のデータがありません
スター
20
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

beyondcode/polyscope-community のほかの issue

beyondcode/polyscope-community の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。