Skip to content

fix: resolve cache/navigation binding and unsafe mutation parallelization - #1811

Draft
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1810-ac11
Draft

skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1810-ac11

Conversation

@skoshx

@skoshx skoshx commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1810

This PR resolves false positives and false negatives in four rules by improving binding resolution and side-effect detection:

Changes

server-cache-with-object-literal

  • Use resolveImportedApiReference and collectBindingAliases to properly track React.cache wrappers through immutable bindings
  • Check all argument positions for fresh objects/arrays (not just the first)
  • Report once per call
  • Shadowed and non-React cache functions stay silent

nextjs-no-redirect-in-try-catch

  • Extend findGuardingTryStatement and catchClauseRethrowsCaught with optional framework rethrow predicates
  • Recognize unstable_rethrow(error) from next/navigation as equivalent to throw
  • Support renamed imports and namespace access (nav.unstable_rethrow(error))
  • Deferred, wrong-error, and shadowed rethrows still report correctly

server-sequential-independent-await and async-parallel

  • Use findSideEffect to detect mutating HTTP requests (POST, PUT, PATCH, DELETE)
  • Preserve ordering for mutations that must run sequentially
  • Independent GET requests continue to report as expected

Testing

  • ✅ All 27,147 tests pass
  • ✅ Added 37 new regression test cases covering:
    • React import resolution with aliases and shadowing
    • Multi-argument object/array detection
    • unstable_rethrow patterns (direct, renamed, namespace)
    • HTTP mutation detection (POST, PUT, PATCH, DELETE, lowercase)
  • ✅ Unit tests validate all edge cases

Scope and Correctness

The changes follow the existing patterns in the codebase:

  • resolveImportedApiReference and collectBindingAliases are existing, well-tested utilities
  • findSideEffect already correctly detects mutating fetch calls
  • Framework rethrow predicates extend the existing try/catch analysis without changing default behavior

Validation Status

⚠️ Parity Check: Full corpus parity was not run due to environment constraints (no baseline data available). The following validations were completed:

  • All focused unit tests pass (37 new regression cases)
  • Existing test suite passes completely (27,147 tests)
  • Changes are targeted and well-scoped to the reported issues

Before merge: Run rde parity to validate that only the intended diagnostic changes appear across the corpus.

Changeset

Included patch-level changeset documenting all four rule fixes.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 14, 2026 22:58
…tion

Fixes #1810

- server-cache-with-object-literal: Use resolveImportedApiReference and
  collectBindingAliases to properly track React.cache wrappers through
  immutable bindings, check all argument positions for fresh objects/arrays,
  and report once per call. Shadowed and non-React cache functions stay silent.

- nextjs-no-redirect-in-try-catch: Extend findGuardingTryStatement and
  catchClauseRethrowsCaught with optional framework rethrow predicates.
  Recognize unstable_rethrow(error) from next/navigation as equivalent to
  throw, including renamed imports and namespace access. Deferred, wrong-error,
  and shadowed rethrows still report.

- server-sequential-independent-await and async-parallel: Use findSideEffect
  to detect mutating HTTP requests (POST, PUT, PATCH, DELETE) and preserve
  their ordering. Independent GET requests continue to report.

Add 37 regression test cases covering binding resolution, multi-argument
detection, unstable_rethrow patterns, and HTTP mutation ordering.

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 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 38a880f

@github-actions

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at 38a880f 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

Development

Successfully merging this pull request may close these issues.

Cache/navigation binding false positives and unsafe mutation parallelization

2 participants