feat(enrichment): floating-promise / unhandled-rejection analyzer - #3524
feat(enrichment): floating-promise / unhandled-rejection analyzer#3524bohdansolovie wants to merge 2 commits into
Conversation
Fixes JSONbored#2023 Co-authored-by: Cursor <cursoragent@cursor.com>
`.finally()` does not consume rejection; only .then/.catch skip the finding. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-05 15:39:57 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 6 non-blocking
Why this is blocked
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/floating-promise.ts:58 checks `PROMISE_CHAIN_RE` against the raw `line`, so `fetch("/.catch(");` is treated as handled even though the production path has a bare floating `fetch`; run the chain check on `codeOnly(line)` instead, e.g. `const code = codeOnly(line).replace(/=>/g, " "); if (isCommentLine(line) || HANDLED_PREFIX.test(line) || PROMISE_CHAIN_RE.test(code)) return null;` and add that regression test.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3524 +/- ##
=======================================
Coverage 93.09% 93.09%
=======================================
Files 301 301
Lines 31450 31450
Branches 11483 11483
=======================================
Hits 29279 29279
Misses 1517 1517
Partials 654 654
🚀 New features to boost your workflow:
|
Summary
Fixes #2023
FloatingPromiseFindingand a localfloatingPromiseanalyzer that flags newly-added promise-shaped calls (fetch,Promise.*,new Promise, or*Asyncsuffix) when the statement is neither awaited, returned, voided, nor same-line.then/.catch-chained.finally()alone is not treated as handled (it does not consume rejection); covered by an explicit unit testsrc/review/enrichment-analyzer-names.tsand generated.env.example/ UI metadatareview-enrichment/test/floating-promise.test.tscovering flagged calls, safe handled variants,.finally()regression, non-JS skip, cap, and brief renderingTest plan
cd review-enrichment && npm run build && npm run metadata && node --test test/floating-promise.test.ts test/analyzer-registry.test.tsvalidate-codeMade with Cursor