[Refactor] Fix incorrect Promise.all usage in app.ts#7512
[Refactor] Fix incorrect Promise.all usage in app.ts#7512gonzaloriestra wants to merge 1 commit intomainfrom
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
WHY are these changes introduced?
The
preDeployValidationfunction inpackages/app/src/cli/models/app/app.tswas not correctly awaiting the validation of all extensions. It was usingPromise.all([this.allExtensions.map(...)]), which creates an array containing a single element (the array of promises returned by.map()).Promise.allthen resolves immediately because it sees an array of non-promise values (the array itself).WHAT is this pull request doing?
Fixed the incorrect
Promise.allusage by removing the unnecessary outer array brackets. Now it correctly awaits all validation promises:Promise.all(this.allExtensions.map(...)).How to test your changes?
Run the tests for the app model:
pnpm --filter @shopify/app vitest run app.test.tsDuplicate check
I ran
git log --grep="Jules" --grep="Refactor" --pretty=format:"%h %s" --max-count=50to check for previous similar PRs.088a35a45 [Refactor] Consolidate command execution in system.ts: Consolidates logic in a different subsystem.aa120fbcf [Refactor] Optimize copyDirectoryContents with glob cwd: Focuses on path handling and performance incli-kit.b79412428 [Refactor] Remove redundant Knip ignoreDependencies entries: Addressesknipconfiguration hints.Checklist
patchfor bug fixes ·minorfor new features ·majorfor [breaking changes]) and added a changeset withpnpm changeset addPR Label: Jules
PR created automatically by Jules for task 14262157258669614203 started by @gonzaloriestra