-
Notifications
You must be signed in to change notification settings - Fork 2
Compost Heap #36
Copy link
Copy link
Open
Labels
Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Relates to the `ITopicRepository` interface or one of its implementations.Status 0: DiscussionNeeds further evaluation of requirements and prioritization.Needs further evaluation of requirements and prioritization.Type: FeatureIntroduces a major area of functionality.Introduces a major area of functionality.
Metadata
Metadata
Assignees
Labels
Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Relates to the `ITopicRepository` interface or one of its implementations.Status 0: DiscussionNeeds further evaluation of requirements and prioritization.Needs further evaluation of requirements and prioritization.Type: FeatureIntroduces a major area of functionality.Introduces a major area of functionality.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, deleted topics are permanently deleted, including all versions and associations. Instead, consider moving them to a hidden area so they can be recovered later.
Considerations
Key Conflicts
This would require renaming deleted topics to avoid key conflicts, and storing attributes necessary for resurrecting the topics (e.g.,
OriginalKey,OriginalParentID).Storage
These could be stored in e.g.,
Root:Deleted. But then they will be fully loaded and cached byITopicRepository.Load(). An alternative would be to store them in aDeletedroot topic. This way, a list of deleted topic could be retrieved using e.g.,ITopicRepository.GetDeletedTopics(), which only lists the e.g., unique key of each top-level deleted topic. This avoids issues such as special handling forMove(),Save(), andRollback()in the OnTopic Editor. In this model, aRestoreTopicstored procedure would be similar toLoadTopic, but would additionally return incoming associations.Associations
Associations with the deleted topic graph pose a problem. The best option is to delete the associations via versioning, so we still have a historical record of them. This would require, at minimum, a
RestoreTopicstored procedure which deletes the last association to and from each restored topic—which will be its deletion. It will then need to return these associations so that they can be restored in memory.Recursive Delete
Descendants should be kept as part of the deleted topic, as this
API
If it weren’t for associations, this could all be handled superficially via the OnTopic Editor. Given the associations issues, though, this will likely require e.g.,
ITopicRepository.Restore(uniqueKey)[dbo].[RestoreTopic]It could also include an API for permanent deletion of (individual?) topics, but my inclination is to handle that manually, similar to version compression, at least for the initial version.