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

CHI-2763 Check for an active contact & complete task #698

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

mythilytm
Copy link
Collaborator

@mythilytm mythilytm commented Oct 1, 2024

Description

This PR introduces two new public functions:|

  • checkTaskAssignment.ts that checks whether a specific call/chat (identified by taskSid) is active.
  • completeTaskAssignment.ts allows a supervisor to switch the assignment status to complete a task.

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags / configuration added

Other Related Issues

None

Verification steps

AFTER YOU MERGE

  1. Cut a release tag using the GitHub workflow. Wait for it to complete and the notification to be posted in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

@mythilytm mythilytm marked this pull request as ready for review October 2, 2024 20:44
@mythilytm mythilytm changed the title Chi 2763 check+close task CHI-2763 Check for an active contact & complete task Oct 2, 2024
Copy link
Collaborator

@GPaoloni GPaoloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

taskSid,
});

console.log('>>> checkTaskStatus Result:', result);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logs before merging? Or keep it a while but let's remember to cleanup at some point.

action: 'complete';
taskSid: string;
targetSid: string;
finalTaskAttributes: TaskInstance['attributes'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do this finalTaskAttributes come from? 🤔 Is that from the supervisor Flex instance? If so, how are those computed? (Maybe I'll answer this question after reviewing the other PR).

Comment on lines +101 to +111
if (!token || token === undefined) {
resolve(error400('token'));
return;
}

try {
const tokenResult: TokenValidatorResponse = await validator(
token as string,
accountSid,
authToken,
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great, but have you checked if tokenResult is not included in the event?

@mythilytm mythilytm merged commit c2f5a37 into master Oct 4, 2024
2 checks passed
@mythilytm mythilytm deleted the CHI-2763-check+close-task branch October 4, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants