Skip to content

[BUG] viewStates prune boundary (missing updatedAt, ties) and dispose retention (#1065) have no regression coverage #1553

Description

@easonLiangWorldedtech

Bug description

The durable per-view viewStates pipeline (vps2 series, #1546) is pinned by a single well-formed-entries prune baseline test (ClineProvider.spec.ts:1210). Three boundary behaviors are untested:

  1. An entry without updatedAt (written before the field existed) ranks last via updatedAt ?? 0 (ClineProvider.ts:634) and is the first to fall off the 50-entry cap — untested.
  2. Ties on updatedAt preserve insertion order (stable sort), so the first 50 registered views survive the cap — untested.
  3. dispose() is retention-only for durable per-view state: a view's viewStates entry must survive provider teardown so an editor tab reopens with its saved selections (Preserve durable editor view state across provider disposal #1065) — untested, so a future teardown rewrite that clears the entry would pass CI.

Expected behavior

Pin all three with regression tests:

  • Pruning a 51-entry map (50 timestamped + 1 without updatedAt) keeps 50 entries and drops the updatedAt-less entry.
  • Pruning 55 entries sharing one updatedAt keeps the first 50 inserted and drops the last 5.
  • After setViewStateId + saveViewState, dispose() leaves the durable entry in viewStates intact.

Reproduction

No failing behavior to reproduce — this is a coverage gap: a dispose() implementation that clears the view's entry (or a prune that drops ties arbitrarily) would pass the existing suite.

Part of the vps2 durable per-view state series — tracked in easonLiangWorldedtech#41.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions