Skip to content

fix: handled promises assigned to vars are valid #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

puglyfe
Copy link
Contributor

@puglyfe puglyfe commented Jul 17, 2025

Checks

Changes

This tweaks the logic in isAssigningKnownAsyncFunctionWrapper to account for return values being assigned to variables. This only impacted await-async-utils, as it is less common to assign the result of an async util to a variable than it is an async query. I've added additional test cases to await-async-queries and await-async-events to explicitly protect against regressions in this behavior.

Context

Fixes #1046

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (35e2b40) to head (a595532).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1047   +/-   ##
=======================================
  Coverage   96.48%   96.49%           
=======================================
  Files          49       49           
  Lines        2678     2681    +3     
  Branches     1107     1112    +5     
=======================================
+ Hits         2584     2587    +3     
  Misses         94       94           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Promise returned from wrapper over async util is not considered handled in a variable declaration
1 participant