Skip to content

Wrong callback sequence #289

Description

@Maurotb

Sample code

private ConcurrentBag agiCurrentCalls = [];

private void Main()
{
ami.Manager.Status += Current_Status;
ami.Manager.StatusComplete += Current_StatusComplete;
while (true){
ami.Manager.SendAction(new StatusAction());
}
}

I receive StatusAction one for any channel
Current_StatusComplete when complete.
Ok but
sometimes i receive Current_StatusComplete before all data go to Current_Status.

To bypass this problem my Current_StatusComplete is

private void Current_StatusComplete(object? sender,StatusCompleteEvent e)
{
        if (e.Items != agiCurrentCalls.Count){
            logger.LogDebug("Library bug intercepted");
            //Retry code
            return;
        }
        //My code
}

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