[PR #125] [MERGED] feat(core): Soft delete #1117

Closed
opened 2026-05-03 01:59:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/reconurge/flowsint/pull/125
Author: @gustavorps
Created: 2/20/2026
Status: Merged
Merged: 3/2/2026
Merged by: @dextmorgn

Base: mainHead: feat/soft-delete


📝 Commits (1)

📊 Changes

2 files changed (+164 additions, -79 deletions)

View changed files

📝 flowsint-core/src/flowsint_core/core/graph/repository.py (+91 -38)
📝 flowsint-core/tests/core/graph/in_memory_graph_repository.py (+73 -41)

📄 Description

This pull request implements soft deletion for nodes and relationships in the graph repository, replacing hard deletes with a deleted_at timestamp. All queries and operations are updated to respect this new soft delete mechanism, ensuring that "deleted" entities are excluded from results and not modified further. The in-memory test repository is also updated to reflect these changes for consistency in testing.

Soft Delete Implementation:

  • All delete operations for nodes and relationships now set a deleted_at timestamp instead of removing records from the database. Associated relationships are also soft-deleted when a node is deleted.

  • The in-memory test repository mirrors this behavior, updating its logic to mark entities as deleted and exclude them from future operations and queries.

Query and Update Adjustments:

  • All queries and update operations now include checks for deleted_at IS NULL to ensure only active (non-deleted) nodes and relationships are returned or modified. This includes node/relationship creation, updating, merging, and graph traversal methods.

Node and Relationship Creation Updates:

  • When creating or merging nodes and relationships, the deleted_at property is explicitly set to null to indicate they are active. [1] [2] [3] [4] [5] [6]

Test Repository Enhancements:

  • The in-memory test repository now fully supports soft deletion, including for batch and position update operations, ensuring test coverage for the new logic.

Documentation Updates:

  • Docstrings and comments are updated to clarify that operations now perform soft deletes and return counts of soft-deleted entities, not hard deletes.

These changes collectively ensure that deletions in the graph are non-destructive and reversible, improving data integrity and auditability.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/reconurge/flowsint/pull/125 **Author:** [@gustavorps](https://github.com/gustavorps) **Created:** 2/20/2026 **Status:** ✅ Merged **Merged:** 3/2/2026 **Merged by:** [@dextmorgn](https://github.com/dextmorgn) **Base:** `main` ← **Head:** `feat/soft-delete` --- ### 📝 Commits (1) - [`a574d4e`](https://github.com/reconurge/flowsint/commit/a574d4ebeac795b88b390b64dabbbdd7300b80ec) feat(core): soft delete ### 📊 Changes **2 files changed** (+164 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `flowsint-core/src/flowsint_core/core/graph/repository.py` (+91 -38) 📝 `flowsint-core/tests/core/graph/in_memory_graph_repository.py` (+73 -41) </details> ### 📄 Description This pull request implements soft deletion for nodes and relationships in the graph repository, replacing hard deletes with a `deleted_at` timestamp. All queries and operations are updated to respect this new soft delete mechanism, ensuring that "deleted" entities are excluded from results and not modified further. The in-memory test repository is also updated to reflect these changes for consistency in testing. **Soft Delete Implementation:** * All delete operations for nodes and relationships now set a `deleted_at` timestamp instead of removing records from the database. Associated relationships are also soft-deleted when a node is deleted. * The in-memory test repository mirrors this behavior, updating its logic to mark entities as deleted and exclude them from future operations and queries. **Query and Update Adjustments:** * All queries and update operations now include checks for `deleted_at IS NULL` to ensure only active (non-deleted) nodes and relationships are returned or modified. This includes node/relationship creation, updating, merging, and graph traversal methods. **Node and Relationship Creation Updates:** * When creating or merging nodes and relationships, the `deleted_at` property is explicitly set to `null` to indicate they are active. [[1]](diffhunk://#diff-f3bdc07426b3407108ada3382e8a46e6097735eee0c27b5bcc7787d66631746bR123) [[2]](diffhunk://#diff-f3bdc07426b3407108ada3382e8a46e6097735eee0c27b5bcc7787d66631746bR149-R154) [[3]](diffhunk://#diff-f3bdc07426b3407108ada3382e8a46e6097735eee0c27b5bcc7787d66631746bL606-R638) [[4]](diffhunk://#diff-f3bdc07426b3407108ada3382e8a46e6097735eee0c27b5bcc7787d66631746bL753-R809) [[5]](diffhunk://#diff-b4d7a5d3a2ed4694f958039099cd175532eb848f669d9e7645f93cd756aefc04R48) [[6]](diffhunk://#diff-b4d7a5d3a2ed4694f958039099cd175532eb848f669d9e7645f93cd756aefc04R57) **Test Repository Enhancements:** * The in-memory test repository now fully supports soft deletion, including for batch and position update operations, ensuring test coverage for the new logic. **Documentation Updates:** * Docstrings and comments are updated to clarify that operations now perform soft deletes and return counts of soft-deleted entities, not hard deletes. These changes collectively ensure that deletions in the graph are non-destructive and reversible, improving data integrity and auditability. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:59:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/flowsint#1117