Skip to content

Conversation

@vimtor
Copy link
Collaborator

@vimtor vimtor commented Dec 18, 2025

when checking what files to upload for static sites we do it in the appropriate order (html then the rest) to avoid deploying a new html that references a not-yet-uploaded file

however, there's still a problem because all the files are uploaded in parallel, so it might still happen that the html file is uploaded before the rest

this pr implements a fix to ensure that the non-html files are always uploaded first

i've tested against some of the AWS `StaticSite` examples and it worked flawlessly CleanShot 2025-12-18 at 18 06 44@2x CleanShot 2025-12-18 at 18 06 51@2x CleanShot 2025-12-18 at 18 06 47@2x

oldFile.ContentType == file.ContentType {
continue
}
if strings.HasSuffix(file.Key, ".html") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be better just to break the files into these 2 groups instead of html and nonHtml:

  • updatedFiles: Files that have an existing key and have a different hash <--- upload these last
  • createdFiles: Files that do not have an existing key <---- upload these first

This should still solve the race issue, and avoids having to bring in and handle specific file extension logic.

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.

2 participants