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

refactor: cmd-add manifest io #233

Merged
merged 2 commits into from
Apr 15, 2024
Merged

refactor: cmd-add manifest io #233

merged 2 commits into from
Apr 15, 2024

Conversation

ComradeVanti
Copy link
Collaborator

Currently, when calling add with multiple packages, each will load, modify and save the project-manifest. This repeated loading and saving was necessary in case a package caused the app to crash, so that previous modifications would still be saved.

For a while now, the app should no longer crash in regular use. Instead it will return error objects. This means we can now safely load and save the manifest only once.

Currently, when calling `add` with multiple packages, each will load, modify and save the project-manifest. This repeated loading and saving was necessary in case a package caused the app to crash, so that previous modifications would still be saved.

For a while now, the app should no longer crash in regular use. Instead it will return error objects. This means we can now safely load and save the manifest only once.
@ComradeVanti
Copy link
Collaborator Author

@favoyang would love your feedback on this. Is there a reason I missed for loading/saving the manifest per package instead of once?

@favoyang
Copy link
Member

@favoyang would love your feedback on this. Is there a reason I missed for loading/saving the manifest per package instead of once?

I agree with you that the add command should modify the manifest atomically.

@ComradeVanti
Copy link
Collaborator Author

I agree with you that the add command should modify the manifest atomically.

The way I implemented it now it is not atomic. If you install A, B and C and B fails, it will still install A and C.

But I could also implement it truly atomic. Let me know.

@favoyang
Copy link
Member

truly atomic would be great.

@ComradeVanti
Copy link
Collaborator Author

Alright, will do. In a separate PR though.

@ComradeVanti ComradeVanti merged commit 3b75ecd into master Apr 15, 2024
4 checks passed
@ComradeVanti ComradeVanti deleted the add-manifest-io-once branch April 15, 2024 13:46
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.

2 participants