You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Utilize new IsDirty() method for evaluating byline, dateline
Instead of manually defining `isDirty` based on a custom LINQ expression, we can now just use the new `AttributeValueCollection.IsDirty()` method introduced in the forthcoming version of the **OnTopic Library** (80fee57).
Technically, because the same update of the library _also_ includes new code in the `TopicRepositoryBase` and e.g. `SqlTopicRepository` for bypassing the byline (`LastModifiedBy`) and dateline (`LastModified`) if no other attributes have been modified, we could just remove this condition entirely.
As this is a cheap condition to validate, however, there remains value to retaining this condition, as it prevents the in-memory copies of the topics from being updated with the byline and dateline. That mitigates confusion of any pages displaying this information—including the **OnTopic Editor**—from being temporarily updated, even though the data won't be persisted to the repository.
In addition, it avoids a rare scenario where another process subsequently modifies one or more attribute on the in-memory topic and `Save()`s it, in which case the dateline and byline would then get persisted, even though they weren't related to that operation. In practice, most subsequent updates would be done by the **OnTopic Editor**, which will always update these attributes with information about the current edit, so this remains a tail risk.
Regardless, by keeping the `IsDirty()` condition in place, we prevent either of those scenarios, even if they're rare, while introducing minimal overhead.
0 commit comments