-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: concurrent cy.prompt() and Studio bundle download issues
#33034
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
Merged
ryanthemanuel
merged 9 commits into
develop
from
ryanm/chore/slight-refactor-for-ensuring-bundles
Dec 2, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d4f38c8
chore: refactor cy.prompt/studio bundle code downloads
ryanthemanuel 1a0a705
additional rework
ryanthemanuel 7f69c96
further refactoring
ryanthemanuel 57feb50
Merge branch 'develop' into ryanm/chore/slight-refactor-for-ensuring-…
ryanthemanuel 71ee03e
add changelog
ryanthemanuel c08155f
Update cli/CHANGELOG.md
ryanthemanuel 61466fc
Update cli/CHANGELOG.md
jennifer-shehane 21159b8
Update cli/CHANGELOG.md
ryanthemanuel 8c10e75
cursor comment
ryanthemanuel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { createReadStream } from 'fs' | ||
| import tar from 'tar' | ||
| import { ensureDir } from 'fs-extra' | ||
| import path from 'path' | ||
| import writeFileAtomic from 'write-file-atomic' | ||
|
|
||
| export const extractAtomic = async (archivePath: string, destinationPath: string) => { | ||
| const entryPromises: Promise<void>[] = [] | ||
|
|
||
| const parser = new tar.Parse() | ||
|
|
||
| parser.on('entry', (entry) => { | ||
| if (entry.type !== 'File') { | ||
| entry.resume() // skip non-files | ||
|
|
||
| return | ||
| } | ||
|
|
||
| const targetPath = path.join(destinationPath, entry.path) | ||
ryanthemanuel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const p = (async () => { | ||
| await ensureDir(path.dirname(targetPath)) | ||
|
|
||
| const chunks: Buffer[] = [] | ||
|
|
||
| for await (const chunk of entry) { | ||
| chunks.push(chunk) | ||
| } | ||
|
|
||
| const content = Buffer.concat(chunks) | ||
|
|
||
| await writeFileAtomic(targetPath, content, { | ||
| mode: entry.mode || 0o644, | ||
| }) | ||
| })() | ||
|
|
||
| entryPromises.push(p) | ||
| }) | ||
|
|
||
| // Pipe archive into parser | ||
| const stream = createReadStream(archivePath) | ||
|
|
||
| stream.pipe(parser) | ||
|
|
||
| // Wait for parser to finish and all entry writes to complete | ||
| await new Promise<void>((resolve, reject) => { | ||
| parser.on('end', resolve) | ||
| // Parser extends NodeJS.ReadWriteStream (EventEmitter), so it supports 'error' events | ||
| // even though the types don't explicitly declare it | ||
|
|
||
| ;(parser as NodeJS.ReadWriteStream).on('error', reject) | ||
| stream.on('error', reject) | ||
| }) | ||
ryanthemanuel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| await Promise.all(entryPromises) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.