Clean up orphaned Y.Docs when workflows are deleted
Open
@theroinaochieng is already working on this.
Since Dec 10, 2025.
- Dominant language
- Elixir
- Stars
- 296
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 50
Description
When workflows are hard deleted (via project purge), their associated collaboration_document_states records are left behind as orphans. This is because the table uses a string document_name (e.g., "workflow:uuid") with no foreign key to workflows, which is intentional to keep the CRDT system decoupled.
We should add a trigger on workflow hard delete (record-level deletion, not soft delete) to clean up associated document states, and run a one-time purge of existing orphaned documents.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.