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

Is updateConversationField a concurrently safe method? #115

Open
lutsykigor opened this issue Apr 7, 2020 · 0 comments
Open

Is updateConversationField a concurrently safe method? #115

lutsykigor opened this issue Apr 7, 2020 · 0 comments

Comments

@lutsykigor
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant