Skip to content

Bug: SqlTopicRepository.Refresh() won't delete attributes #45

@JeremyCaney

Description

@JeremyCaney

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.

Metadata

Metadata

Assignees

Labels

Priority: 1Severity 1: MinorStatus 5: CompleteTask is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions