Skip to content

fix(campaign-task): Ensure Skipped/Removed Task are removed from task list#718

Open
cmullenx wants to merge 1 commit into
webex:nextfrom
cmullenx:chrmulle/fixCampaigns
Open

fix(campaign-task): Ensure Skipped/Removed Task are removed from task list#718
cmullenx wants to merge 1 commit into
webex:nextfrom
cmullenx:chrmulle/fixCampaigns

Conversation

@cmullenx

@cmullenx cmullenx commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-8145

This pull request addresses

  • skipped/removed campaign previews would remain on task list if there was no new campaign preview task incoming

by making the following changes

*updating the campaign preview logic

Vidcast: https://app.vidcast.io/share/d19111bb-fd22-4c7f-a240-4d57ae32c813

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

Tested accepting campaigns, skipping, removing campaigns, and campaign timeout action.

  • 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
    • Other - Windsurf
  • 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.

@cmullenx cmullenx requested a review from a team as a code owner July 8, 2026 14:32
@cmullenx cmullenx added validated Indicates that the PR is ready for actions run_e2e Add this label to run E2E test for meeting and CC widgets labels Jul 8, 2026
@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-718.d1b38q61t1z947.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: 7f9deb82f9

ℹ️ 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".

// Hide call control when the current task is a campaign preview that
// the agent has not yet accepted. Matches agent desktop behavior where
// call controls are only shown after the preview contact is accepted.
if (currentTask && isUnacceptedCampaignPreview(currentTask, acceptedCampaignIds)) {

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 Keep call-control hooks before preview guards

The early return now runs before useCallControl. When acceptedCampaignIds changes while currentTask still references a campaign task, for example handleTaskRemove removes the id before clearing currentTask, this render can return before calling hooks that were called on the previous render, causing React's hook-order error and hiding call controls via the error boundary. Keep useCallControl unconditional before this guard, and apply the same ordering in CallControlCAD.

Useful? React with 👍 / 👎.

import {test} from '@playwright/test';
import createCampaignPreviewTests from '../tests/campaign-preview-test.spec';

test.describe('Campaign Preview Tests', createCampaignPreviewTests);

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 Register the campaign preview suite in Playwright

playwright.config.ts builds projects only from USER_SETS and matches **/suites/${setData.TEST_SUITE} (lines 33-40), but playwright/test-data.ts has no TEST_SUITE: 'campaign-preview-tests.spec.ts' entry, so yarn test:e2e never selects this new suite. That leaves the campaign regression unexercised in CI unless the suite is added to the project list/test data.

Useful? React with 👍 / 👎.

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

Labels

run_e2e Add this label to run E2E test for meeting and CC widgets validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants