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

[Reactive] CommandAttribute(isEnabled=false) not stored anywhere #1482

Closed
weitzhandler opened this issue May 22, 2023 · 3 comments · Fixed by #1483
Closed

[Reactive] CommandAttribute(isEnabled=false) not stored anywhere #1482

weitzhandler opened this issue May 22, 2023 · 3 comments · Fixed by #1483
Assignees
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@weitzhandler
Copy link
Member

Current behavior

The CommandAttribute class reads:

[AttributeUsage(AttributeTargets.Method)]
public class CommandAttribute : Attribute
{
    public CommandAttribute(bool isEnabled = true)
    {
    }
}

Expected behavior

The parameter isEnabled should be stored.

@weitzhandler weitzhandler added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels May 22, 2023
@weitzhandler
Copy link
Member Author

Also, inspecting the code here

It seems it only checks if a method has this attribute completely ignoring its value.
Furthermore, if this attribute exists and its value is false, it should exit the if statement and opt-out of command generation for this method as it's been explicitly excluded.

I'm happy to PR.

@weitzhandler
Copy link
Member Author

Seems this functionality works well. I also learned that those properties are not required.
Anyway, I added a test case that checks the reverse behavior of disabled implicit class and explicitly enabled method.
#1483.

@nickrandolph
Copy link
Contributor

So does the current behaviour mean that [Command(false)] doesn't work to opt out of command creation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants