Skip to content
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

Fix chunk symlinks to ensure overwriting old links #3868

Merged
merged 1 commit into from Feb 25, 2021

Conversation

mwest1066
Copy link
Member

The ensureSymlink() function silently does nothing if the destination already exists, even if it isn't the correct symlink (see jprichardson/node-fs-extra#786, jprichardson/node-fs-extra#869, jprichardson/node-fs-extra#826). This means that with the new symlink chunk code (see #3354) we will never update a question chunk, even when there is a new version of the question available. To work around this we create the link with a temporary name and move it to the correct link name.

Copy link
Collaborator

@nicknytko nicknytko left a comment

Choose a reason for hiding this comment

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

Just as a quick sanity check, rename() will overwrite any existing file if targetPath already exists, right?

@mwest1066
Copy link
Member Author

Just as a quick sanity check, rename() will overwrite any existing file if targetPath already exists, right?

Yep, I tested it because I no longer trust anything 😄

@mwest1066
Copy link
Member Author

Successfully tested on staging.

@mwest1066 mwest1066 merged commit 2303938 into master Feb 25, 2021
@mwest1066 mwest1066 deleted the fix-chunk-symlinking branch February 25, 2021 02:09
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.

None yet

2 participants