Skip to content

Conversation

@alfonso-noriega
Copy link
Contributor

@alfonso-noriega alfonso-noriega commented Oct 29, 2025

WHY are these changes introduced?

The current archiving functionality in zip and brotliCompress methods doesn't handle race conditions where files might be deleted during the archiving process. This can lead to errors and failed builds when files are removed while the archiving is in progress.

WHAT is this pull request doing?

Improves the archiving process to gracefully handle files that are deleted during the archiving operation:

  1. Modifies the zip and brotliCompress functions to read file content immediately before adding to the archive
  2. Adds error handling to skip files that are deleted during the archiving process
  3. Adds comprehensive tests to verify the new behavior works correctly

How to test your changes?

theme-test.zip

  1. Download the included zip with a test them app.
  2. Run shopify app dev --path path/to./the/downloaded/app in a terminal
  3. Within the app folder run pnpm theme-extension:dev to run vite
  4. In a new terminal window, within the theme extension folder run the script rapid-changes.sh included in the zip.
    These steps will start a never ending loop of changes to the extension files in batches of a random size which will eventually trigger the error we are trying to reproduce.

Once the error is reproduced running dev with the latest CLI, to test the changes go to the CLI repo, checkout this branch, and run pnpm shopify app dev --path path/to./the/downloaded/app (don't forget to close the previously started dev session).

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

Checklist

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

Copy link
Contributor Author

alfonso-noriega commented Oct 29, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.27% (+0% 🔼)
13598/17154
🟡 Branches
73.15% (+0.01% 🔼)
6648/9088
🟡 Functions
79.35% (+0% 🔼)
3504/4416
🟡 Lines
79.63% (+0.01% 🔼)
12844/16129
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / archiver.ts
87.1% (-2.38% 🔻)
66.67%
76.47% (+1.47% 🔼)
91.23% (-1.08% 🔻)

Test suite run success

3358 tests passing in 1372 suites.

Report generated by 🧪jest coverage report action from d6c771d

@alfonso-noriega
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @alfonso-noriega! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251029171255

Caution

After installing, validate the version by running just shopify in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@alfonso-noriega alfonso-noriega force-pushed the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch 5 times, most recently from 3d4bf3a to 490af62 Compare October 31, 2025 12:27
@alfonso-noriega alfonso-noriega force-pushed the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch 2 times, most recently from 53e1e4f to a515640 Compare October 31, 2025 12:53
@alfonso-noriega alfonso-noriega marked this pull request as ready for review October 31, 2025 14:09
@alfonso-noriega alfonso-noriega requested a review from a team as a code owner October 31, 2025 14:09
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@alfonso-noriega alfonso-noriega force-pushed the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch from a515640 to 2c0f953 Compare November 3, 2025 09:45
Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

Had to make a slight change to the test script:

# Directory containing the files
DIR="${HOME}/Downloads/theme-test/extensions/theme-extension/frontend/entrypoints"

if [ ! -d "$DIR" ]; then
    echo "Directory $DIR does not exist. Exiting."
    exit 1
f

Tophat is giving me build errors that look the same on both branches though... Wondering if I'm missing steps?

@alfonso-noriega alfonso-noriega force-pushed the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch 2 times, most recently from aec5821 to bb52e42 Compare November 5, 2025 10:10
@alfonso-noriega alfonso-noriega force-pushed the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch from bb52e42 to d6c771d Compare November 5, 2025 11:10
@alfonso-noriega alfonso-noriega added this pull request to the merge queue Nov 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2025
@alfonso-noriega alfonso-noriega added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main with commit 7bf1d6b Nov 5, 2025
30 checks passed
@alfonso-noriega alfonso-noriega deleted the 10-29-avoid_problems_with_them_extensions_self_built_by_external_vite branch November 5, 2025 11:41
@gonzaloriestra gonzaloriestra changed the title Avoid problems with them extensions self built by external vite Avoid problems with theme extensions self built by external vite Nov 13, 2025
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.

4 participants