Attributes can be null when returned from the database. This happens when a previous attribute was deleted; the new version will use a null value. When loading values as part of e.g. ITopicRepository.Refresh() or Rollback(), 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 that Save() doesn't include clean indexed attributes when calling the SaveTopic stored procedure.
Cause
The SetIndexedAttributes() extension method skips over null values. That was fine when this was only used to create new topics. With the OnTopic 5.0.0 support for passing a referenceTopic to Load(), however, this potentially prevents existing topics from being properly updated with new attributes. This is most notable with ITopicRepository.Refresh(), since the goal is explicitly to update existing topics with new values.
Attributes can be
nullwhen returned from the database. This happens when a previous attribute was deleted; the new version will use anullvalue. 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
nullvalues 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 theSaveTopicstored procedure.Cause
The
SetIndexedAttributes()extension method skips overnullvalues. That was fine when this was only used to create new topics. With the OnTopic 5.0.0 support for passing areferenceTopictoLoad(), 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.