EventLog: expose sync status per remote (connected, retrying, last error, pending uploads)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend, observability
調査の方向性
Start with packages/effect/src/eventlog/EventLog.ts and EventJournal.ts, especially the remote loop, withRemoteUncommited, and writeRemoteAcks references in the issue. Trace how the remote loop records connection, retry, and acknowledgement events, and how the service exposes read-only state. Done means the status is available per remote with the fields and transitions described in the proposal, including an empty map when no remote is registered.
索引モデルが issue の本文から書いたものです。
説明
Clanked by Opus 5.5
What is the problem this feature would solve?
The EventLog module of the week shows how a device writes events offline and syncs them later. A UI built on that needs to tell the user what is going on: "3 changes wait to sync", "Sync failed: forbidden", "Synced". EventLog gives no way to know.
- The
EventLogservice haswrite,writeMany,entries,destroyandcompact(EventLog.ts#L110-L166). Nothing reports per-remote state or the number of entries not yet acknowledged. - The remote loop retries every failure forever with
remoteRetryScheduleand only logs it:Effect.tapCause(Effect.logDebug)for uploads andEffect.catchCause(Effect.logError)for the change stream (EventLog.ts#L1489-L1490, #L1517-L1534). AForbiddenfrom the server looks the same to the app as a short network drop. navigator.onLineis not a substitute. The browser can be online while the sync server is down or refuses the identity.
The data exists inside the runtime: the journal knows the uncommitted entries per remote (withRemoteUncommited, writeRemoteAcks, nextRemoteSequence, EventJournal.ts#L139-L157), and the loop knows when it connects, fails and retries.
What is the feature you are proposing to solve the problem?
A read-only status per remote on the EventLog service, as a Subscribable (or a Stream plus a current value):
interface RemoteStatus {
readonly remoteId: RemoteId
readonly state: "connecting" | "connected" | "retrying"
readonly pendingUploads: number // local entries the remote has not acknowledged
readonly lastError: EventLogRemoteError | undefined
readonly nextRetryAt: number | undefined // epoch millis while "retrying"
readonly lastSyncedAt: number | undefined
}
class EventLog extends Context.Service<EventLog, {
// ...existing members
readonly status: Subscribable.Subscribable<ReadonlyMap<RemoteId, RemoteStatus>>
}>() {}
// A UI reads it as any other stream:
const banner = Stream.map((yield* EventLog).status.changes, (all) =>
[...all.values()].some((s) => s.state === "retrying") ? "Offline, changes are saved on this device" : "Synced")
pendingUploadschanges after each local write and eachwriteRemoteAcks.statemoves toretryingwithlastErrorwhen an upload or the change stream fails, and back toconnectedafter a successful authenticate.- With no remote registered, the map is empty.
What alternatives have you considered?
- Wrap
EventLogRemotein the app and track calls towriteandchanges. This works for the connection state, but the pending count needs journal internals, and the wrapper must copy the retry logic to know when a retry happens. - Read
EventLog.entriesand compare with the remote sequence. This reads the whole journal on every change, and the remote sequence is not exposed onEventLog. - Parse the debug logs. Fragile and not typed.
- 主要言語
- TypeScript
- スター
- 16.7k
- フォーク
- 808
- 平均マージ
- 21時間 22分
- マージ済み PR(30日)
- 486
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Effect-TS/effect のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing components対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11097 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11096 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
Effect-TS/effect の issue をすべて見る
似ている issue
-
check:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
iptv-org/iptv#60585 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts対応中かも @Piyush4801 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jaegertracing/jaeger-ui#4865 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信