Skip to content

Participant drop functionality and tests - #5174

Open
ajitkumar0828-spec wants to merge 5 commits into
webex:nextfrom
ajitkumar0828-spec:feature/participant-drop
Open

Participant drop functionality and tests#5174
ajitkumar0828-spec wants to merge 5 commits into
webex:nextfrom
ajitkumar0828-spec:feature/participant-drop

Conversation

@ajitkumar0828-spec

@ajitkumar0828-spec ajitkumar0828-spec commented Aug 18, 2026

Copy link
Copy Markdown

COMPLETES #< INSERT LINK TO ISSUE >

This pull request addresses

< DESCRIBE THE CONTEXT OF THE ISSUE >

by making the following changes

< DESCRIBE YOUR CHANGES >

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@ajitkumar0828-spec
ajitkumar0828-spec requested a review from a team as a code owner August 18, 2026 09:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fe344435c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +476 to +479
data: {
type: CC_EVENTS.PARTICIPANT_LEFT_CONFERENCE,
interactionId: p.interactionId,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bind drop completion to the requested participant

When any other participant leaves the same conference while this request is pending, this bind also matches that ParticipantLeftConference event because it checks only the interaction ID. AqmReqs then resolves and clears the drop request even if the requested target remains or later produces a failure, so callers receive a false success. Include the requested participant ID in the success correlation bind, and likewise correlate the failure bind where supported.

AGENTS.md reference: packages/@webex/contact-center/AGENTS.md:L51-L51

Useful? React with 👍 / 👎.

Comment on lines +1430 to +1434
const customerNumber = hasActiveCustomer ? getCustomerNumber(interaction) : '';
const customer = customerNumber
? {
participantId: customerNumber,
displayName: customerNumber,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Send the customer's roster identifier to the drop API

When a conference includes a customer and another participant, the Drop customer action uses ANI/DNIS as participantId, although the SDK endpoint expects the backend participant identifier from the task roster. Clicking the button therefore targets the phone number rather than the customer's participant record and can reject or time out; retain the customer's resolved roster ID for participantId and use the number only as displayName.

Useful? React with 👍 / 👎.

@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-5174.d3m3l2kee0btzx.amplifyapp.com

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2564fe942c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/samples/contact-center/app.js Outdated
Comment on lines +1318 to +1320
const consultMedia = Object.values(task?.data?.interaction?.media || {}).find(
(media) => media?.mType?.toLowerCase() === 'consult'
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check the current consult leg before enabling Drop

When the interaction retains more than one consult-media entry, this selects the first entry even though getCurrentConsultMedia() immediately above resolves the configured or latest consult leg. If an older leg is held but the current leg is active and unheld, hasActiveNonHeldConsult() returns false and enables participant Drop during the active consult; the inverse ordering incorrectly disables it. Use the current consult-media selection here so the roster reflects the leg the agent is actually controlling.

Useful? React with 👍 / 👎.

@Kesari3008 Kesari3008 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Except test files and .md files, reviewed the code

"contracts": {
"provides": [
"Published @webex/contact-center package; ContactCenter WebexPlugin; public SDK methods, events, types, Task, AddressBook, ApiAIAssistant, UserPreference, cc.userPreference, exported user-preference request/response types, and preview-campaign methods acceptPreviewContact/skipPreviewContact/removePreviewContact"
"Published @webex/contact-center package; ContactCenter WebexPlugin; public SDK methods, events, types, Task, AddressBook, ApiAIAssistant, UserPreference, cc.userPreference, exported user-preference request/response types, preview-campaign methods acceptPreviewContact/skipPreviewContact/removePreviewContact, and DropConferenceParticipantPayload/task.dropConferenceParticipant"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we adding specifically about this feature in the manifest file. I dont consult, tranfer or conference flows explicitly mentioned here so why only this feature

method: METHODS.CREATE_PROMISE,
});
}
const eerr = new Err.Details(notifFail.errId, msg as any);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a typo here for this error variable, we can fix it. Also why do we need to add this condition ?

actions: ['updateTaskData', 'clearConsultState', 'emitTaskConsultEnd'],
},
],
[TaskEvent.PARTICIPANT_LEAVE]: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This state transition is not following the definition of state machine. target and actions are the property it takes which is missing here. Why is a new event being introduced like this ?

public async dropConferenceParticipant(
payload: DropConferenceParticipantPayload
): Promise<TaskResponse> {
const participantId = payload?.participantId;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

payload is mandatory param in the method definition so why is ? present marking it optionally being present

* @returns Promise<TaskResponse>
*/
public async dropConferenceParticipant(
payload: DropConferenceParticipantPayload

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This payload seems to be be having just one property, why have created new type for it. We can directly say in the definition participantId: string and also if we are specifically defining it to be string why is the string check in the if block needed

},
];

const survivingParticipantLeaveTransition = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This optimization is unncessary

actions: ['updateTaskData', 'clearConsultState', 'emitTaskConsultEnd'],
},
],
[TaskEvent.PARTICIPANT_LEAVE]: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why would be any Agent in Connected state if they are in conference. Connected state is only for 1:1 call with customer. And when a participant leave happens, it can only happen in conference state. This transition may not be valid

target: TaskState.CONNECTED,
actions: ['updateTaskData'],
},
[TaskEvent.PARTICIPANT_LEAVE]: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment here. We will have to evaluate if drop is something being attempted in HOLD_INITIATING state or RESUME_INITIATING state

handleConferenceStarted: assign({consultInitiator: false}),

setConsultDestination: assign(({event}: TaskActionArgs) => {
setConsultDestination: assign(({context, event}: TaskActionArgs) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why have we introduced this change ?

// agent is absent from the updated participants, they have left.
const participants = taskData?.interaction?.participants;
if (participants && !(selfAgentId in participants)) {
const currentParticipant = taskData?.interaction?.participants?.[selfAgentId];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would like to discuss this change ?

@Kesari3008

Copy link
Copy Markdown
Contributor

Update Jira description with JIRA link, changes done and vidcast link for testing done in SDK

@Kesari3008 Kesari3008 added the validated If the pull request is validated for automation. label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants