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

Unsafe double comparison in Divide rule can trigger infinite loop #3

Closed
jessehouwing opened this issue Oct 2, 2014 · 0 comments
Closed

Comments

@jessehouwing
Copy link
Collaborator

The divide rule does a double division and then compares it to the previous value. When a difference is detected, the work item is flagged for saving.

Either due to TFS doing rounding on double values for storage or teh double value comparison going wrong due to differences in precision, this comparison sometimes fails (e.g. 20/35) causing the aggregator to keep flagging the field as changed.

The code causing the issue is in:
https://github.com/rbanks54/TFSAggregator/blob/master/TFSAggregator/Aggregator.cs :60

I suggest either using a safer double comparison method (with a maximum precision) or by setting a desired precision on the different numeric rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants