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

Improve seshat deleteContents #1916

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

langleyd
Copy link
Member

@langleyd langleyd commented Oct 11, 2024

Provides workaround(fixes search "Reset" button) for #1822

The problem I saw was that a file with a prefix like .atomicwrite.<ID> existed in the EventStore directory that the application did not have permissions to delete(got a "Error: EPERM: operation not permitted" error for the unlink). Maybe a seshat write was in progress during a previous run of the app when it was aborted, leaving it orphaned.

As there was no try/catch within the loop in deleteContents it would failed to delete any of the files after .atomicwrite.<ID> (most of them likely). This meant subsequent initialisations of seshat didn't work and it could never be reset in the UI.

@langleyd langleyd requested a review from a team as a code owner October 11, 2024 13:16
Copy link
Member

@robintown robintown left a comment

Choose a reason for hiding this comment

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

This looks fine - logging the errors could prove helpful though

@robintown robintown removed the request for review from MidhunSureshR October 11, 2024 15:33
@langleyd
Copy link
Member Author

Thanks @robintown , we were swallowing the errors at the call site before, so wasn't sure if there was a reason for that. But yea, maybe better to log them, mind taking another look?

@langleyd langleyd requested a review from robintown October 11, 2024 16:29
@langleyd langleyd merged commit 838cf3b into develop Oct 16, 2024
32 checks passed
@langleyd langleyd deleted the langleyd/fix_seshat_delete_contents branch October 16, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants