Skip to content
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

Improve Dev error details on extension validation #4853

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

isaacroldan
Copy link
Contributor

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.55% (-0.8% 🔻)
8421/11449
🟡 Branches
69.49% (-0.65% 🔻)
4102/5903
🟡 Functions
73.24% (-0.63% 🔻)
2217/3027
🟡 Lines
74.06% (-0.82% 🔻)
7962/10751
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / migrate-app-module.ts
89.19% (-0.28% 🔻)
85.71% 90.91%
91.18% (-0.25% 🔻)
🔴
... / dev-session.ts
3.54% (-0.72% 🔻)
0%
3.85% (-0.7% 🔻)
3.88% (-0.82% 🔻)
🔴
... / cli.ts
1.41% (-98.59% 🔻)
0% (-75% 🔻)
0% (-100% 🔻)
1.56% (-98.44% 🔻)
🔴
... / custom-oclif-loader.ts
0% (-28.13% 🔻)
0% (-11.9% 🔻)
0% (-33.33% 🔻)
0% (-28.13% 🔻)
🟡
... / error-handler.ts
66.33% (-10.2% 🔻)
68.52% (-9.26% 🔻)
57.14% (-14.29% 🔻)
66.67% (-10.42% 🔻)
🟡
... / error.ts
79.31% (-6.9% 🔻)
73.53% (-2.94% 🔻)
92.31% (-7.69% 🔻)
78.57% (-7.14% 🔻)
🟡
... / path.ts
73.33% (-3.33% 🔻)
72.22%
68.75% (-6.25% 🔻)
74.07% (-3.7% 🔻)
🔴
... / system.ts
33.33% (-1.55% 🔻)
21.43% (-1.9% 🔻)
62.5% (-4.17% 🔻)
34.29% (-1.43% 🔻)

Test suite run success

1925 tests passing in 875 suites.

Report generated by 🧪jest coverage report action from b6d9afb

Comment on lines +267 to +271
errors.forEach(async (error) => {
const on = error.on as {user_identifier: string}
const extension = options.app.allExtensions.find((ext) => ext.uid === on.user_identifier)
await printError(error.message, stdout, extension?.handle ?? 'dev-session')
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forEach with async operations won't wait for all promises to resolve. Use Promise.all(errors.map()) to ensure all errors are processed before the function returns. This avoids potential race conditions and ensures proper error handling.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

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.

1 participant