Skip to content

Fix: delete workflow file when removing a workflow#1193

Open
nimitbhardwaj wants to merge 1 commit into
RightNow-AI:mainfrom
nimitbhardwaj:fix/workflow-delete
Open

Fix: delete workflow file when removing a workflow#1193
nimitbhardwaj wants to merge 1 commit into
RightNow-AI:mainfrom
nimitbhardwaj:fix/workflow-delete

Conversation

@nimitbhardwaj
Copy link
Copy Markdown
Contributor

Summary

  • 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, causing them to reappear

Fix

  • Modified delete_workflow() in crates/openfang-api/src/routes.rs to also delete the .json file from disk when removing a workflow

Testing

  • Lint (cargo clippy) and build (cargo build --workspace --lib) pass

Related Issue

Fixes: #1192

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
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.

Deleted workflow reappears after daemon restart

1 participant