Fix potential zip upload error when deduping files on a very large Storybook #892
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.
When publishing a Storybook with > 1000 files, the processing happens in batches. When using the
zip
option, each batch returns azipTarget
. However, if there are no files to upload for a batch,zipTarget
will beundefined
. Previously the CLI would use whateverzipTarget
was returned last, even if thatzipTarget
isundefined
. In this case, the CLI falls back to uploading individual files, but thesentinelUrl
for unpacking the zip file will still be present and the CLI will wait for the unpack that will never happen, eventually timing out with a failed build.This PR fixes the
zipTarget
by ignoring batches that have nozipTarget
. Additionally, it deduplicatessentinelUrls
because each batch returns the same basicsentinelUrl
, with only a deviating query param (signature). We only really need to await one of them. Also, logging is improved to clarify which type of sentinel file we're dealing with (files-copied
orzip-unpacked
).📦 Published PR as canary version:
10.3.2--canary.892.7557813674.0
✨ Test out this PR locally via: