Skip to content

Auto-refresh: apply the setting live, and make the list-changed indicator diff-aware #1444

@cliffhall

Description

@cliffhall

Follow-up to #1402 (PR #1443). Two related refinements to list-changed handling.

Implemented in PR #1445.

1. Apply the Auto Refresh setting live (no reconnect)

Today InspectorClient.getServerSettings() returns the settings captured at client construction, so toggling Auto Refresh on List Changed Notifications in Server Settings only takes effect on the next (re)connect (consistent with headers/timeouts/OAuth; only roots applies live).

Acceptance criteria

  • InspectorClient gains setServerSettings(settings) (on InspectorClientProtocol + the fake), updating the in-memory settings the state managers read at notification time.
  • When the user saves Server Settings for the currently connected server, the live client's settings are updated so the next */list_changed honors the new value without a reconnect.
  • Tests: setter updates the value read by getServerSettings(); a state manager honors the new value after a live update.

2. List-changed indicator behavior (auto-refresh off)

Originally specified as diff-aware: fetch on */list_changed, compare to the current list, and light the indicator only when it actually differs (to avoid the everything server's identical re-sends lighting it falsely). This was implemented — but on testing, the maintainer found the diff-aware peek issues a tools/list on every settled burst even with auto-refresh off, which is unwanted: auto-refresh off should mean no automatic network. Reverted to a blind indicator — a (debounced) */list_changed lights the indicator with no fetch; the user pulls the new list via Refresh.

Acceptance criteria (final, post-revert)

  • In flag-only mode (auto-refresh off), a */list_changed lights the indicator with no list call; the displayed list is untouched.
  • Bursts are debounced — one indicator light per burst, not one per notification.
  • Auto-refresh-on mode is unchanged (debounced fetch + replace, no indicator).
  • Tests: list_changed lights the indicator without fetching; burst → single debounced flip, no fetch.

Accepted trade-off: with no fetch-to-compare, the indicator lights even when the server re-sent an identical list (the everything-server case). That's the cost of zero automatic network when auto-refresh is off; the diff-aware alternative was tried and rejected.

Added beyond the original scope (PR #1445)

  • Debounce + coalesce */list_changed bursts — the everything server emits a rapid burst; the managed-list base debounces (default 250ms) so a burst collapses into a single indicator light (or one fetch in auto-refresh mode), with an in-flight guard coalescing a post-debounce notification that lands during a slow auto-refresh.
  • Consolidation — the four per-primitive managers were extracted onto a generic ManagedListState<T, M> base (−245 lines), addressing the triplication flagged in review.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions