Repository navigation
fix: remove stale watchers when overwriting references - #1216
Open
YashAnand69 wants to merge 2 commits into
Open
YashAnand69 wants to merge 2 commits into
YashAnand69 wants to merge 2 commits into
Conversation
Resolve test import overlap while retaining upstream reactive changes. Assisted-by: Codex:GPT-6
Author
|
Merged current main (af94e0c) in 6bd0d7d and resolved the test-import conflict, preserving the newer reactive implementation. Re-ran the three original regressions against exact current-main production source: both collection cases still fail, while the surviving nested-reference control passes. With this patch, reference tests pass (91 passed, 1 skipped); the full tests directory reports 1,977 passed, 40 skipped, 2 xfailed and 8 subtests passed. Pinned pre-commit checks pass. The production fix and its scope are unchanged; documentation notebooks were not run. AI-assisted conflict resolution and independent diff review. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Overwriting a parameter reference with a plain value removes its reference entry but leaves the source watcher attached. A detached view remains alive while another view uses the same source, and a detached source can also remain alive unnecessarily.
Route removal through the existing reference-registration cleanup so obsolete watchers are removed and watchers for the remaining references are rebuilt. Async cancellation continues through that same path. Three regression cases cover collection of the detached target and source, and synchronization of a remaining nested reference.
Refs #963. This addresses overwritten references; it does not change ownership or retention of references that remain active.
Reproduction:
On main, the two collection regressions fail and the remaining-reference case passes. With the fix,
pytest tests/testrefs.py -qreports 91 passed and 1 skipped.pytest tests -qreports 1,977 passed, 40 skipped, 2 xfailed and 8 subtests passed on Python 3.12.14. Changed-file pre-commit checks pass, including Ruff and typos. Documentation notebook tests were not run.These screenshots show live diagnostic output from the reproduction above, rendered with Panel; this is a nonvisual memory-management fix.
Related documentation: Parameter references, developer guide.
AI Disclosure
Tool & Model: Codex with GPT-6.
Usage: assisted with tracing watcher retention, implementation, regression tests, running checks, reviewing the diff and preparing this description. The reproduction was run against main and the fix; the test results and limitations above are from actual executions.
Checklist
October 31 follow-through: merged latest main af94e0c via 6bd0d7d, resolving the test import conflict while preserving current upstream reactive changes. The two collection regressions still fail on exact latest-main production source; the shared nested-reference control passes. The counts above are from the updated branch. Pinned pre-commit checks pass; upstream tests/zizmor workflows await maintainer approval. AI-assisted resolution and independent final-diff review.