Skip to content

triage: issue #1736 investigation - recommend splitting into 4 focused PRs - #1737

Draft
skoshx wants to merge 3 commits into
mainfrom
cursor/triage-1736-2390
Draft

skoshx wants to merge 3 commits into
mainfrom
cursor/triage-1736-2390

Conversation

@skoshx

@skoshx skoshx commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Investigation Summary

Deep analysis (110k+ tokens) reveals issue #1736 encompasses 4 distinct root causes, each requiring different fix approaches:

  1. Closure-held cleanup (case 1) - Complex mutable variable dataflow
  2. Callback ref disposal (case 2) - React contract recognition
  3. Observer + forEach (case 3) - Clear semantic, lowest complexity
  4. Handler allocations (case 4) - Architectural ownership model

Files Added

  • ISSUE-1736-ANALYSIS.md - Technical deep-dive on all 4 cases
  • TRIAGE-1736-RECOMMENDATION.md - Prioritization and rationale
  • effect-needs-cleanup-issue-1736.test.ts - Failing reproduction tests

Recommendation

Rather than attempting a unified fix that risks false negatives:

  1. Split into 4 separate focused issues
  2. Start with Case 3 (forEach + observers) - lowest risk
  3. Each PR gets independent testing + parity validation
  4. Ensures correctness over speed

Why Not Fix All 4 Now?

  • Different root causes require different strategies
  • False negatives worse than false positives (triage playbook)
  • Complex 9000+ line effect-needs-cleanup.ts needs careful changes
  • Rushing risks silencing real memory leaks

Next Steps

Seeking maintainer input on:

  1. Agree to split into 4 issues?
  2. Priority order correct?
  3. Should I implement Case 3 fix in follow-up PR?

See linked files for full technical analysis.

Closes #1736

Open in Web Open in Cursor 

cursoragent and others added 3 commits September 1, 2026 04:28
Four cases of false positives where cleanup happens through indirection:
1. Cleanup function stored in variable and called
2. Callback ref with React's null-on-unmount contract
3. Observer.observe() in forEach, disconnect() at top level
4. Timer in event handler, cleared in cleanup

All four should pass but currently fail.

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Investigation reveals 4 distinct issues, not one unified dataflow problem:

1. Closure-held cleanup (complex dataflow through mutable vars)
2. Callback ref disposal (React contract recognition)
3. Observer forEach (clear semantic, lowest risk)
4. Handler allocations (architectural ownership model)

Recommend focused PRs per case rather than unified fix to avoid
false negatives. Case 3 (forEach) most tractable for initial fix.

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1737
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1737
npm i https://pkg.pr.new/react-doctor@1737

commit: 31652b3

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at 31652b3 in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

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

Labels

None yet

Projects

None yet

2 participants