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

Fixed the debounce extension in order to update to the last action pa… #4294

Merged
5 commits merged into from
Oct 7, 2021

Conversation

matheus-inacio
Copy link

@matheus-inacio matheus-inacio commented Oct 2, 2021

Fixes #4293

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

The debounce extension was incorrectly updating the action in the ConcurrentList.

According to documentation the value passed in the updateValueFactory function, of the AddOrUpdate method, is the current value in the dictionary.

https://docs.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.addorupdate?view=net-5.0

image

Therefore the current behavior is maintaining the old action and not updating with the new passed action.

_debounceInstances.AddOrUpdate(timer, action, (k, v) => v);

What is the new behavior?

Changed so that the action in the _ debounceInstances Dictionary is updated with the latest version.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Contains NO breaking changes
  • Tests for the changes have been added
  • Header has been added to all new source files (run build/UpdateHeaders.bat)

Other information

PS: The debuonce extension is referenced in the CanvasPathGeometryPage class (although this changes does not seem to break it).

@ghost
Copy link

ghost commented Oct 2, 2021

Thanks matheus-inacio for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker, azchohfi and Rosuavio October 2, 2021 22:47
@ghost ghost added the bug 🐛 An unexpected issue that highlights incorrect behavior label Oct 2, 2021
@net-foundation-cla
Copy link

net-foundation-cla bot commented Oct 4, 2021

CLA assistant check
All CLA requirements met.

@net-foundation-cla
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ matheus-inacio sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@michael-hawker michael-hawker added this to the 7.1.1 milestone Oct 5, 2021
@ghost
Copy link

ghost commented Oct 7, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 84adf91 into CommunityToolkit:main Oct 7, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merge ⚡ bug 🐛 An unexpected issue that highlights incorrect behavior extensions ⚡
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DispatcherQueueTimerExtensions bug
3 participants