Skip to content

Bound diff reconnect repeats a completed patch refusal #3986

Description

@leaf-agent

The bound variant of tests/browser/test_render_diff_controls.py::test_a_patch_that_failed_stays_failed_when_its_diff_returns fails in CI run 40211090125, at commit d91276596d59.

After showing “unified diff repeats file path a.txt”, the test removes the diff, waits a task, reinserts it and waits three animation frames. It expects the original .lf-error node to survive. Instead the assertion fails with “the returning diff rendered its refused patch again”. Teardown also catches a second console error for the same refused patch, from replacementFile → parsedFiles → sourceRecords → show. The inline variant passes in that run.

The failure concerns retaining a completed refusal across reconnect, rather than retrying preparation that departure interrupted. At the failing commit, lf-diff reads its bound snapshot in render(), compares it with #shown in updated(), and starts show() when they differ; disconnect invalidates #shown if #showing is true. The causal boundary still needs reproduction: distinguish a changed delivery identity from an incorrectly restarted or cleared failure. Inspect the shared data delivery and element lifecycle before adding a diff-specific guard.

Related prior fix #3527 added a shouldUpdate gate for inline diffs and reported both reconnect variants passing then. Its diff explicitly leaves bound diffs updating; it does not settle this bound-only failure. PR #3983 gates redraw after setup throws, a different path from this asynchronous parse refusal.

Reproduce on current main first, using the focused node above and the repository's test guidance. This report session has read the CI failure, but has not run that test locally or established the introducing commit.

Cause of a failure tracked in #3985.

Activity

  1. added
    tend-ci-cause
    on Oct 25, 2026
  2. leaf-agent commented on Oct 25, 2026

    @leaf-agent
    CollaboratorAuthor

    Fixed in #3987, which merged after CI passed on the reviewed head. The reproduced failure came from an unchanged reconnect update clearing the existing error box; the diff itself skipped parsing. The teardown diagnostic was the original refusal left unconsumed when the assertion stopped the test.

    Bound values now reach the widget before its update gate, so the diff can retain an unchanged refusal while still following later deliveries. Five focused browser cases pass, covering reconnect, corrected bound data, interrupted preparation and finished rows; pnpm run check also passes, including all 559 runtime tests.

  3. leaf-agent commented on Nov 2, 2026

    @leaf-agent
    CollaboratorAuthor

    Reopened from push run 41395985405, after #3987 landed. The bound case now fails with “the returning diff cleared its completed refusal”. The inline case also fails, waiting for #d-bad .lf-error to contain “repeats file path”; teardown retains the parse refusal through replacementFile → parsedFiles → sourceRecords → show. These are current CI diagnostics, not a local reproduction or proof that the earlier mechanism returned. The reopened triage worker owns reproducing both variants on current main and tracing the completed-refusal lifecycle against later changes.

  4. leaf-agent commented on Nov 4, 2026

    @leaf-agent
    CollaboratorAuthor

    Both variants reproduce on current main, and a git bisect run of the test since #3987 names #4800 (63a1b97c7) as the first failing commit. #4800 made the thread surface's Comment opener an input to lf-diff's update gate. When the surface registers, either on load for an inline patch or again when a bound diff returns, the opener changes, the update passes the gate, and LeafElement.update() removes the failure box. show() doesn't run again because the source hasn't changed, so the refusal stays gone.

    #5346 carries the fix. Its first commit narrowed the gate, and both variants passed locally; that head's CI also went green. A maintainer asked for the owner-level repair, so the PR now stages the refusal in the diff's shadow stage, where only the next show() replaces it, and drops the gate. That head is under review and CI, which will decide its landing.

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

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions