-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Code Quality: Only execute actions once #13397
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
Code Quality: Only execute actions once #13397
Conversation
…rather than continuous action upon button press
@yaira2 Ready for review. Fully implemented. |
@yaira2 Thank you for the review. I'm waiting for further instruction. Is this on track to be merged to main? |
redo and undo actions shouldn’t be limited, but otherwise I think all actions should be. |
I think they should, we wouldn't want someone undoing multiple operations by mistake. |
I think we should do that, I can't think of any use-case where a user needs to execute the same action over and over. It may also prevent some bugs we are not aware of. |
…decorator applied to all actions.
…o 11737_Execute_Limits_Jerrod
@yaira2 @ferrariofilippo change fully implemented for all actions. Ready for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few feedbacks, mostly on the format.
The functionnality looks good to me, I cannot test it for now.
@QuaintMako @yaira2 Suggestions taken and implemented. I left one action with an optional value of 1000 milliseconds for demonstration. The others are defaulted at 800ms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
being particular but needed. LGTM otherwise, thank you!
PS.
Can you fix merge conflicts? You can fix most of all by fetching from upstream/main; otherwise you can fix in merge editor in VS2022.
{ | ||
public abstract class DebouncedAction : IAction | ||
{ | ||
private DateTime lastExecuted = DateTime.MinValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastExecutedTime
{ | ||
private DateTime lastExecuted = DateTime.MinValue; | ||
|
||
private readonly TimeSpan debounceTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debounceTimeSpan
8f185f3
to
8139d77
Compare
Branch synced with main as of now. No conflicts. Ready to merge. The constructor suggestion you gave me @QuaintMako to eliminate nullability gave errors that I'd need to look more into later. I think this is good for now. |
@yaira2 Could I get an update on this? I think it's ready to merge. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@HorseBandit can you take a look at the build error? |
@yaira2 Fresh sync followed by a merge of 'main' into this branch. There are no build errors. |
I think this is a pipeline bug iirc, don't remember what we used to do to fix it |
@HorseBandit do the test projects run locally? It seems to be failing in the PR. |
@yaira2 Yes they do. Test results for main and this branch are identical. |
Azure Pipelines successfully started running 1 pipeline(s). |
@HorseBandit I think the best option is to duplicate the branch and create a new PR. |
a827a37
to
20e04d0
Compare
Resolved / Related Issues
Closes Feature: Only execute certain actions once #11737
Validation
How did you test these changes?
Screenshots (optional)
Add screenshots here.