Vonage / vonage-dotnet-sdk

Vonage REST API client for .NET, written in C#. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com/
Apache License 2.0
106 stars 86 forks source link

Conversation StartOnEnter documentation inconsistent with behaviour #575

Closed MarcusKohnert closed 5 months ago

MarcusKohnert commented 6 months ago

Describe the bug The documentation of the property StartOnEnter says that The default value of true ensures that [...]. If an instance of type ConversationAction is instantiated via the default constructor, the property StartOnEnter gets a value of false assigned (default value for boolean). This is an inconsistency between the documentation and the runtime behaviour.

This lead me to the scenario that I've created a conversation with attendees but the conversation never started because StartOnEnter was always false.

To Reproduce

var action = new ConversationAction
{
    Name = "some-name"
};

new Ncco(action).ToString();

Expected behaviour

[
    {
        "action": "conversation",
        "name": "some-name",
        "startOnEnter": true
    }
]

Actual behaviour

[
    {
        "action": "conversation",
        "name": "some-name",
        "startOnEnter": false
    }
]

Environment:

Additional context I guess that is an unwanted side effect of #463

Tr00d commented 6 months ago

Hi @MarcusKohnert,

Thanks for raising that one. It is indeed a nasty side effect of #463.

The default value isn't handled is in the SDK but it initially wasn't serialized in the JSON body when the default value was provided, delegating the decision of default value (true) to the API.

I'll include that in the following release.

Tr00d commented 6 months ago

Hi @MarcusKohnert,

This has been fixed in the latest version, v7.2.2.

Let me know if it works out for you.

Tr00d commented 5 months ago

Closing issue after two weeks. Don't hesitate to reach out if yoou face any problem.