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: rework file handling so we always explicitly create, overwrite or both #12812

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

zackpollard
Copy link
Contributor

@zackpollard zackpollard commented Sep 20, 2024

Due to nodejs/node#41093 we are unable to open hidden files with the 'w' flag on windows and some samba shares. This got me thinking, and realistically we should never actually need to open files with the w flag anyway. In all contexts within immich we know if we are opening a file for creating or overwriting, so we can explicitly use those actions in those contexts. This means we now have more protections when creating file, as if somehow a file exists on the filesystem, but we didn't expect it to, the code will error rather than overwrite it.

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

While you are here, do you want to change the messages to use UPLOAD_LOCATION instead of MEDIA_LOCATION?

@zackpollard zackpollard force-pushed the fix/hidden-files-smb-unable-to-overwrite branch from d2b3066 to 5c1fb4b Compare September 20, 2024 23:06
@zackpollard
Copy link
Contributor Author

While you are here, do you want to change the messages to use UPLOAD_LOCATION instead of MEDIA_LOCATION?

Done 😄

@zackpollard zackpollard enabled auto-merge (squash) September 20, 2024 23:07
@zackpollard zackpollard merged commit 5a1a841 into main Sep 20, 2024
35 checks passed
@zackpollard zackpollard deleted the fix/hidden-files-smb-unable-to-overwrite branch September 20, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants