Fix: delete workflow file when removing a workflow#1193
Open
nimitbhardwaj wants to merge 1 commit into
Open
Conversation
When a workflow is deleted via the API or dashboard, only the in-memory entry was removed but the corresponding .json file in ~/.openfang/workflows/ was left behind. On daemon restart, load_workflows_from_dir() would re-import these 'deleted' workflows. Now the .json file is removed when delete_workflow() is called. Fixes: RightNow-AI#1192
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.jsonfile in~/.openfang/workflows/was left behindload_workflows_from_dir()would re-import these "deleted" workflows, causing them to reappearFix
delete_workflow()incrates/openfang-api/src/routes.rsto also delete the.jsonfile from disk when removing a workflowTesting
cargo clippy) and build (cargo build --workspace --lib) passRelated Issue
Fixes: #1192