Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.
This repository was archived by the owner on May 2, 2023. It is now read-only.

Is updateConversationField a concurrently safe method? #115

@lutsykigor

Description

@lutsykigor

We are currently using .updateConversationField method in our service to transfer a customer to another agent. Our service is a REST API that transfers a customer using a single instance of the LE Node.js bot.

Is it safe, after all? I mean, we are calling .updateConversationField like this:

this.updateConversationField({
                'conversationId': conversationId,
                'conversationField': [{
                    'field': 'ParticipantsChange',
                    'type': 'ADD',
                    'role': 'MANAGER'
                }]
            }, async (err, resp) => {
                this._handleTransportError(err);
                await asyncOperation1;
                await asyncOperation2;
            });

from our request handling logic. Which means, that we can initiate a call to.updateConversationField multiple times, without waiting for response, and then our callbacks are an async functions, that are, also, divided into multiple async phases.

Will node-agent-sdk handle this concurrent flow correctly?
What are the best practice, of using this lib in race situations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions