fix(contact-center): read mediaResourceId from interaction.media in holdResume()#4863
Open
bhabalan wants to merge 1 commit intowebex:task-refactorfrom
Open
Conversation
…oldResume() Port of webex#4848 to task-refactor branch. The holdResume() method in Voice.ts was reading mediaResourceId from the top-level this.data.mediaResourceId, which can become stale after partial event payloads (e.g. recording events) overwrite task data. Changed to read from the canonical source at this.data.interaction.media[mainInteractionId].mediaResourceId, with a fallback to the top-level field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7507
This pull request addresses
Port of #4848 to the
task-refactorbranch. TheholdResume()method inVoice.tsreadsmediaResourceIdfrom the top-levelthis.data.mediaResourceId, which can become stale after partial event payloads (e.g. recording pause/resume events) overwrite task data. Although the refactoredreconcileData()on this branch doesn't delete missing keys (unlikenext), using the top-level field is fragile and inconsistent with how the canonical media data is stored ininteraction.media.by making the following changes
holdResume()inpackages/@webex/contact-center/src/services/task/voice/Voice.tsto resolvemediaResourceIdfromthis.data.interaction.media[mainInteractionId].mediaResourceId— the canonical source — with a fallback to the top-levelthis.data.mediaResourceIdmainInteractionIdto the test data helpercreateBaseData()in the Voice test filehold()usesinteraction.mediaas the source formediaResourceIdeven when the top-level field is staleChange Type
The following scenarios were tested
Automated Testing
hold() reads mediaResourceId from interaction.media via mainInteractionId— simulates stale top-levelmediaResourceIdand verifies the correct value is sent tocontact.hold()xstate.setupinfrastructure issue ontask-refactorthat is unrelated to this change)The GAI Coding Policy And Copyright Annotation Best Practices
I certified that