Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumericAggregation within a work item triggers an infinite loop #8

Open
giuliov opened this issue Feb 14, 2015 · 0 comments
Open

NumericAggregation within a work item triggers an infinite loop #8

giuliov opened this issue Feb 14, 2015 · 0 comments
Labels
Milestone

Comments

@giuliov
Copy link
Collaborator

giuliov commented Feb 14, 2015

In case you set up a numeric aggregation within the same work item, this might result in an infinite loop. Normally a change of a source value should only trigger a single update of the target field thanks to the explicit check in the code to only update the target field in case the aggregated value is different than the current stored value.
However in case doubles are used you have a possible rounding issue to take into account. The code does not check on the small difference that can occur due to the internal represenation of doubles in .Net.
This results in the work item ending up in an infinite update loop and causes a lot of records in the table 'WorkItemsWere' to be created (history).
You are able to notice this after a while as opening and saving the work item will take up drastically more time due to this.

To resolve this issue you could for example modify line 52 in Aggregator.cs in the following way:

if (Math.Abs(aggregateValue - targetWorkItem.GetField(configAggregatorItem.TargetItem.Name, 0)) < 0.1)

Source: CodePlex Issue 844

@giuliov giuliov added the bug label Feb 14, 2015
@giuliov giuliov modified the milestone: vNext Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant