Bug: SqlTopicRepository.Refresh()
won't delete attributes
#45
Labels
Priority: 1
Severity 1: Minor
Status 5: Complete
Task is considered complete, and ready for deployment.
Type: Bug
Behavior that is inconsistent with documented or expected behavior.
Milestone
Attributes can be
null
when returned from the database. This happens when a previous attribute was deleted; the new version will use anull
value. When loading values as part of e.g.ITopicRepository.Refresh()
orRollback()
, this should result in deleting any existing attribute values, if present. Currently, this does not happen.Impact
If the
null
values are skipped, any previous values will be retained in memory. There may also be circumstances where this could result in those values being inadvertently persisted to the database—though, fortunately, this will generally be avoided by the fact thatSave()
doesn't include clean indexed attributes when calling theSaveTopic
stored procedure.Cause
The
SetIndexedAttributes()
extension method skips overnull
values. That was fine when this was only used to create new topics. With the OnTopic 5.0.0 support for passing areferenceTopic
toLoad()
, however, this potentially prevents existing topics from being properly updated with new attributes. This is most notable withITopicRepository.Refresh()
, since the goal is explicitly to update existing topics with new values.The text was updated successfully, but these errors were encountered: