Skip to content

Diff-state over SSH: live push on repository change - #64

Merged
jwp2987 merged 1 commit into
mainfrom
parity-remote-diffstate-livepush
Aug 5, 2026
Merged

Diff-state over SSH: live push on repository change#64
jwp2987 merged 1 commit into
mainfrom
parity-remote-diffstate-livepush

Conversation

@jwp2987

@jwp2987 jwp2987 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Completes the daemon side of code-review diff-state over SSH. After the initial subscribe snapshot (PR #61), the daemon now pushes fresh snapshots as the repository changes, so a remote code-review view stays live.

What changed

  • ServerModel gains a per-connection subscription registry (diff_state_subscriptions: conn -> Vec<DiffStateSubscription>). Each subscription stores the canonicalized repo path (matched against repository-change events) and the exact wire path string the client sent (echoed in pushed snapshots so the client's RemoteDiffStateModel keys on it).
  • handle_get_diff_state registers the subscription after computing the initial snapshot; handle_unsubscribe_diff_state removes it; deregister_connection drops all of a connection's subscriptions on teardown.
  • On RepoMetadataEvent::RepositoryUpdated (the daemon already subscribes to it), push_diff_state_for_repo recomputes and pushes a DiffStateSnapshot (no request_id — an unsolicited push, handled by the client's push_message_to_event) to every connection subscribed to that repo.
  • The subscribe reply and the live push share snapshot_from_parts so the Loaded/Error/NotInRepository decision is identical.

MetadataUpdate / FileDelta (finer-grained, debounced) pushes remain available on the wire for a future optimization; RepositoryUpdated-driven full snapshots are the correct, debounce-free baseline.

Verification

  • warp lib compiles (gui,tui,local_fs,test-util)
  • remote_server 46/0 (incl. new snapshot_from_parts test)
  • code_review 76/0

Note

This makes the manager DiffState*Received push events (wired in PR #61) live end-to-end once the remote consumer is constructed. The remaining piece — wiring remote repos into the code-review pane (increment 5c) — carries a design decision and is left for the maintainer.

🤖 Generated with Claude Code

Completes the daemon side of code-review diff-state over SSH: after the initial
subscribe snapshot, the daemon now pushes fresh snapshots as the repository
changes, so a remote code-review view stays live.

- ServerModel gains a per-connection subscription registry
  (diff_state_subscriptions: conn -> Vec<DiffStateSubscription>). Each
  subscription stores the canonicalized repo path (matched against repository
  change events) and the exact wire path string the client sent (echoed in
  pushed snapshots so the client's RemoteDiffStateModel keys on it).
- handle_get_diff_state registers the subscription after computing the initial
  snapshot; handle_unsubscribe_diff_state removes it; deregister_connection
  drops all of a connection's subscriptions on teardown.
- On RepoMetadataEvent::RepositoryUpdated (the daemon already subscribes to it),
  push_diff_state_for_repo recomputes and pushes a DiffStateSnapshot (no
  request_id — an unsolicited push, handled by the client's
  push_message_to_event) to every connection subscribed to that repo.
- The subscribe reply and the live push share snapshot_from_parts (in
  diff_state_proto) so the Loaded/Error/NotInRepository decision is identical.

MetadataUpdate / FileDelta (finer-grained, debounced) pushes remain available on
the wire for a future optimization; RepositoryUpdated-driven full snapshots are
the correct, debounce-free baseline.

Verified: warp lib compiles (gui,tui,local_fs,test-util); remote_server 46/0
(incl. new snapshot_from_parts test), code_review 76/0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012gDYSHa4oDvQbfungWwG1h
@jwp2987
jwp2987 merged commit dc55bff into main Aug 5, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant