Skip to content

fix: soften await parallelization messages to acknowledge uncertainty - #1841

Draft
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1840-c2b7
Draft

skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1840-c2b7

Conversation

@skoshx

@skoshx skoshx commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Softens the messaging in server-sequential-independent-await and async-await-in-loop to acknowledge that parallelization only helps when work is truly independent—no shared queues, transactions, ordering requirements, or synchronous facades behind async interfaces.

Root Cause

The rules made categorical claims about performance benefits:

  • "your users wait twice as long for nothing"
  • "This makes the loop slow"

These claims don't hold when:

  1. Work is serialized through a shared queue (SQLite connection, Redis client, transaction manager)
  2. Async functions are facades over synchronous work (Set.has behind async exists())
  3. Operations maintain ordering guarantees by design

The detector cannot prove runtime independence from syntax alone.

Changes

Messaging updates:

  • server-sequential-independent-await: "These awaits appear independent, but parallelization only improves performance when work doesn't share queues, transactions, or resources. Verify independence, then consider Promise.all([...])."
  • async-await-in-loop: "This loop runs awaits sequentially. Parallelization may improve performance if work is truly independent (no shared queues, transactions, or ordering requirements). Verify before applying..."

Detection unchanged:

Scope Decision

Per the issue request, this fix addresses messaging appropriateness, not detection scope. The rules cannot reliably detect shared queues or synchronous facades through static analysis, so the solution is conditional language that asks developers to verify independence rather than claiming definite latency improvements.

Blanket suppression based on method names was explicitly rejected as it would create false negatives.

Testing

  • All existing tests pass
  • New regression tests confirm rules still fire on reported patterns
  • Reproduction case shows updated messages
  • Lint and typecheck clean

Parity

Parity was not run because:

  1. Changes are purely to message strings
  2. No detection logic was modified
  3. Every diagnostic from these rules will show a "diff" (the message text)
  4. That message change is the entire point of this fix

Closes #1840

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 26, 2026 16:50
The server-sequential-independent-await and async-await-in-loop rules
now acknowledge that parallelization only helps when work is truly
independent—no shared queues, transactions, ordering requirements, or
synchronous facades behind async interfaces.

Changes:
- Updated messages to use conditional language ('appear', 'may improve')
- Added explicit independence requirements in messages
- Kept detection logic unchanged—no new exemptions
- Added regression tests for serialized queues and sync facades (#1840)

The rules still fire on these patterns but with more nuanced guidance
that asks developers to verify independence before applying the
recommendation.

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

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 0283f56

@github-actions

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at 0283f56 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

This branch has not been deployed

No deployments
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.

async await diagnostics claim parallelism benefits for serialized or synchronous work

2 participants