Skip to content

Bug: GetAttributes() should not return mismatched attributes if !isDirty #44

@JeremyCaney

Description

@JeremyCaney

Currently, the TopicRepository.GetAttributes() method will include attributes under its isDirty check if their IsExtendedAttribute property doesn't match the IsExtendedProperty value of the AttributeDescriptor, even if the AttributeRecord is otherwise clean. This usually happens if the location that an attribute is configured to save has been updated since the attribute was last saved. By detecting these as dirty, we ensure they will get updated with the next Save().

Confusingly, these attributes will also be returned if isDirty is set to false. That doesn't hurt anything in our current logic, but it could lead to potential bugs in the future. If nothing else, it's inconsistent and unintuitive; an attribute should be able to be clean and dirty at the same time. Basically, the difference here is whether we're measure attributes that are either explicitly or implicitly dirty, or just explicitly dirty.

While we're at it, we may want to evaluate how these are returned along with isExtendedAttribute. If an AttributeRecord was not loaded with IsExtendedAttribute, but its AttributeDescriptor is set to IsExtendedAttribute, should it be returned with the isExtendedAttribute parameter? I think it should be. Basically, isExtendedAttribute should follow the AttributeDescriptor, and ignore the AttributeRecord. (It may already do this, but we should confirm.)

Metadata

Metadata

Assignees

Labels

Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Priority: 3Severity 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