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

Correctly handle module files missing from a previously patched save #613

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

Danielv123
Copy link
Member

Resolves #611

image

Logs missing files instead of throwing an error.

Copy link
Collaborator

@Cooldude2606 Cooldude2606 left a comment

Choose a reason for hiding this comment

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

Log a warning that the file went missing. The current patch logic already replaces all patched in files with files from the modules to patch in.

The above is implemented as was suggested by Hornwitser.
However, is leaving the empty buffers in the map a good idea?

As seen by your edit to line 398/405 you needed to add a check to account for non-existent files in the map.
In the future if we provided a method to extract and save modules from a save file, then we would end up writing empty files if we didnt also account for the empty buffers.
In your issue this was a git ignore file that went missing, and I'd argue an incorrectly empty one is more dangerous than no file at all.

This can be fixed with a .filter after the .map, should we?

@Cooldude2606 Cooldude2606 merged commit c37fe0f into clusterio:master Apr 27, 2024
3 checks passed
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.

Unable to restart instance after a patched in file is deleted
2 participants