-
Notifications
You must be signed in to change notification settings - Fork 2
Validate !IsNew on TopicRepository methods #77
Copy link
Copy link
Closed
Labels
Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Relates to the `ITopicRepository` interface or one of its implementations.Priority: 2Severity 1: MinorStatus 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.Behavior that is inconsistent with documented or expected behavior.
Milestone
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.Priority: 2Severity 1: MinorStatus 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.Behavior that is inconsistent with documented or expected behavior.
Currently, the
TopicRepositorycorrectly validates that the topic(s) being operated against withMove(),Rollback(), andDelete()aren’tnull, but it doesn’t validate that they’re notIsNew. Similarly,Save()doesn’t validate that the parent topic has been saved. There isn’t a way to persist changes to a topic in this state.Options
There are a few options if there are attempts to perform these operations against a new topic:
ITopicRepository()to perform the validation, thus leaving room for e.g., in-memory data stores, but also complicating the code; orThe latter could potentially cover up upstream bugs by failing silently—and especially with certain edge cases, such as moving a saved topic after an unsaved sibling. But it also allows a consistent approach for working with in-memory topic graphs, independent of whether they’re saved.