-
Notifications
You must be signed in to change notification settings - Fork 40
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
cordova prepare misses updated files with same size and older timestamp #61
Comments
What code from common is actually involved here? |
From the reproduction project I gave in the description: cordova-common/src/FileUpdater.js Lines 100 to 105 in 470718c
There may be a way to work around this in an |
Do we know how it comes to be that the "latest" source version of the file has an older timestamp than a copy of an earlier version of it? |
I suspect this could be triggered in one of 2 ways:
I think git should not do this kind of thing. |
Thanks for providing that list @brodybits. At least on Linux (and probably macOS) the following holds:
Unfortunately AFAICT the only way to know if the files are different is actually reading the contents. However, check sums don't make much sense here. You would have to read both However, even with the optimized approach above you would have to read every unchanged file twice in its entirety. As unchanged files probably make up the majority of files, I don't think we want to do that. After thinking about this long and hard, I asked myself "What would To conclude, I think we should not start comparing the file contents in PS: There is a |
Although not directly related to the issue. I ended up changing line 100 in cordova-common/src/FileUpdater.js Lines 100 to 105 in 470718c
to check if source time > target time rather than >= In my scenario I have many static assets that never change that kept being copied because the source and target time were the same. Which is to be expected of static assets so I am not sure why the >= check Also I use a live reload approach so there are often updates with only minor changes often in a single file only thus the speed of prepare needs to be as fast as possible as to assure an effective live reload experience |
As reported by @knight9999 on Slack: if a file in
www
is updated to have the same size but an older timestamp compared to the corresponding file withinplatforms
thencordova prepare
will miss the file. Reproduction is given in: https://github.com/knight9999/sampleUnupdateI think the best solution would be to check the md5 sum whenever the file in
www
and the corresponding file inplatforms
have the same size.The text was updated successfully, but these errors were encountered: