-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-filysystem] Video files created several times #4863
Comments
Weird bug... how are those files getting to the public directory? Nothing copies them there by default. |
@KyleAMathews Worth mentionning that the duplicated files are also present in |
gatsby-source-filesystem doesn't copy anything unless you query the files is my point. What's your query? |
query currentPageQuery($id: String!) {
wordpressPage(id: { eq: $id }) {
title
content
date(formatString: "MMMM DD, YYYY")
acf {
video {
source_url
localFile {
publicURL
}
}
}
}
} |
You want to search for the code handling this and debug what's happening? |
I have too much other things in my hands to do that just yet, it'll be days before I could get to that. |
Here you go!
|
I can reproduce it locally - so it seems server doesn't handle etag/304 and we will redownload file everytime - I would assume this changes |
@sebastienfi if you will have time you can check #4872, which partially helps with this issue (creating multiple copies in and for corrupted files - it seems that |
@pieh same diagnostic here. |
I think #4872 is included in |
#4872 effectively impacts the bug in 2 ways :
|
#4872 won't change anything with clean/first build - I couldn't reproduce duplicate files on initial build from reproduction wordpress site and code from your description. It also didn't address corrupted files situation. |
@sebastienfi another PR, this time for corrupted files - #4877 |
Do you still get corrupted files in Or you still have duplicates? Again I couldn't reproduce it anymore too with updated There's not much more I can think of right now if I can't reproduce problem anymore :/ |
Yup, solved. |
Description
After I run
gatsby build
I found myself with apublic
folder of 2go for a website that has only 100Mo of assets. Looking at the generated files, I found a few hundreds of MP4 and WEBM files duplicated with the same contents.We only have 1 MP4 and 1 WEBM assets, we ended up with hundreds of them duplicated.
Reproducing the error on OSX, we found only 2 duplicates not hundreds as seen on Windows.
The duplicates does not all have the same disk size, although some does.
Looking at the encodings details, I can see that a re-encoding happened, that's why my natural idea is to look on the side of Sharp or gatsby-source-filesystem for solution to this bug. While on OSX all the videos can be played, on Windows only the duplicates with the size of the original video can be read, other videos are corrupted.
Building the repro example, I noticed that the problem doesn't occurs with small video files (500Ko). With a medium sized file (9Mo), the problem occurs already.
Steps to reproduce
yarn run install && yarn run build
./public/static/
that the video file gets duplicated.If you are using OSX or Linux you may see a lesser number of duplicates but still.
Expected result
The video file should be only once in the
./public/static/
folder.Actual result
The video file is duplicated several times on the
./public/static/
folder.Environment
npm list gatsby
): gatsby@1.9.246gatsby --version
): 1.9.244File contents (if changed):
gatsby-config.js
: addedgatsby-source-filesystem
to copy the downloaded media assets to the static folder.package.json
: not changed fromexamples/using-wordpress
gatsby-node.js
: not changed fromexamples/using-wordpress
gatsby-browser.js
: not changedgatsby-ssr.js
: not changedThe text was updated successfully, but these errors were encountered: