Skip to content

Conversation

oguzhankoral
Copy link
Member

My initial attempt was on Timers, but I had random behaviors on Autocad, then decided to go with percentage difference checks. Since we round decimals on UI, we don't need to send progress updates less than %1. OperationProgressManager handles it with concurrent dictionary. Open to suggestions, I might do more tests before merging it.

Copy link

linear bot commented Aug 6, 2024

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 8.21%. Comparing base (3074855) to head (4f739df).

Files Patch % Lines
...onnectors.DUI/Bindings/OperationProgressManager.cs 0.00% 16 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             dev    #106      +/-   ##
========================================
- Coverage   8.24%   8.21%   -0.04%     
========================================
  Files        230     231       +1     
  Lines       4367    4383      +16     
  Branches     505     508       +3     
========================================
  Hits         360     360              
- Misses      3997    4013      +16     
  Partials      10      10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/// Debouncing progress for every %1 update for UI.
/// This class requires a specific bridge in its binding, so registering it will create random bridge which we don't want to.
/// </summary>
public class OperationProgressManager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this class a singleton and inject it on usage. The Bridge isn't needed until set is called so doesn't need to be on the constructor.

How does it know it's done? Does the diff only care if it's changed, not if it's greater?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point

didimitrie and others added 3 commits August 6, 2024 15:38
Copy link
Member

@adamhathcock adamhathcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smells better

@oguzhankoral oguzhankoral merged commit 82e95f9 into dev Aug 6, 2024
5 checks passed
@oguzhankoral oguzhankoral deleted the oguzhan/cnx-183-debouncing-progress-updates branch August 6, 2024 15:03
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

Successfully merging this pull request may close these issues.

3 participants