Skip to content

Conversation

@bhabalan
Copy link
Contributor

@bhabalan bhabalan commented Dec 16, 2025

COMPLETES #CAI-7461

This pull request addresses

Consulting agent / EP / DN names are incorrect after an MPC

by making the following changes

Fix name enumeration logic

Vidcast: https://app.vidcast.io/share/e38ade5c-6537-45ec-81b7-c4d97a2fbb33

Pasted Graphic 2 Pasted Graphic 5 Pasted Graphic 4

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

  • The testing is done with the amplify link
    < 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
    • Cursor
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@bhabalan bhabalan requested review from akulakum and rsarika December 16, 2025 04:33
@bhabalan bhabalan self-assigned this Dec 16, 2025
@bhabalan bhabalan added the validated Indicates that the PR is ready for actions label Dec 16, 2025
Copy link

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

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.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +490 to +494
const result = getControlsVisibility(deviceType, featureFlags, task, 'agent1', true);

// End button should be enabled when switched back to main call from consult
expect(result.end.isEnabled).toBe(true);
expect(result.end.isVisible).toBe(true);

Choose a reason for hiding this comment

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

P1 Badge End button stays disabled after consult is put on hold

The newly added consult scenarios expect the main End button to become enabled once the consult leg is on hold (e.g., after switching back to the main call), but getEndButtonVisibility still unconditionally disables End whenever any consult is in progress (!isConsultInitiatedOrAcceptedOrBeingConsulted), regardless of whether the consult media is on hold. With the data in this test (consult mType held, main call active), the function currently returns isEnabled: false, so this test will fail and the agent still cannot hang up the main call after returning from a consult. Consider updating the End-button logic to account for the consult hold status before expecting it to be enabled.

Useful? React with 👍 / 👎.

@aws-amplify-us-east-2
Copy link

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

Access this pull request here: https://pr-585.d1b38q61t1z947.amplifyapp.com

const [consultTimerLabel, setConsultTimerLabel] = useState<string>(TIMER_LABEL_CONSULTING);
const [consultTimerTimestamp, setConsultTimerTimestamp] = useState<number>(0);
const [lastTargetType, setLastTargetType] = useState<'agent' | 'queue'>('agent');
const [lastTargetType, setLastTargetType] = useState<'agent' | 'queue' | 'entryPoint' | 'dialNumber'>('agent');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace the inline union type
useState<'agent' | 'queue' | 'entryPoint' | 'dialNumber'>
with a shared enum or constant-based TargetType to avoid string duplication, improve type safety, and make future refactors safer.

(participant as Participant).pType === 'Agent' && (participant as Participant).id !== myAgentId
);
// For Entry Point or Dial Number consults, check if destination agent has joined
if (lastTargetType === 'entryPoint' || lastTargetType === 'dialNumber') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add enum or constant-based TargetType to avoid string duplication

Copy link
Contributor

@akulakum akulakum left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants