Drop Button Implementation in widgets - #735
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13b15ed84f
ℹ️ 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".
| if (pendingRequest && (pendingRequest.taskId !== participantDropTaskId || pendingRequest.task !== currentTask)) { | ||
| pendingParticipantDropRef.current = null; | ||
| } | ||
| }, [currentTask, controls]); | ||
|
|
||
| setPendingParticipantDropId(null); | ||
| setParticipantDropAnnouncement(null); | ||
| }, [currentTask, participantDropTaskId]); |
There was a problem hiding this comment.
Preserve pending drops across same-interaction refreshes
Reset the pending request only when the interaction actually changes, not whenever currentTask gets a new object identity. StoreWrapper.refreshTaskList() calls setCurrentTask(), which clones the task even when its interaction ID is unchanged, and participant-left/UI-control events invoke that refresh during the event-correlated SDK request. This effect therefore clears the global lock and announcement before the promise continuation runs, allowing a second Drop and suppressing the normal success or failure feedback for the first request.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f10ce0e50
ℹ️ 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".
|
|
||
| // Prefer the observable task data when it already contains the current leg; | ||
| // fall back to the state-machine snapshot during the brief hydration gap. | ||
| const taskDataCandidates = [task.data, snapshotTaskData].filter((taskData): taskData is RosterTaskData => |
There was a problem hiding this comment.
Prefer the newest consult snapshot over stale task data
When a completed consult leg remains in task.data and a subsequent EP-DN consult is present only in state.context.taskData, this ordering returns the old leg immediately, so the newer snapshot is never examined. This is a supported transition in this repository—other consult logic explicitly accounts for retained old media and fresher initiator snapshots—and can make the Drop roster show the prior destination or omit the current ringing/answering participant until hydration catches up. Compare leg recency/current media IDs across both candidates rather than accepting the first consult entry.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 053e6f46f7
ℹ️ 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".
| const consultIsActive = | ||
| hasVisibleControls(task?.uiControls?.consult) || ['consult', 'consulting'].includes(interactionState); |
There was a problem hiding this comment.
Recognize consults exposed on the main controls
When a nested or EP-DN consult keeps interaction.state at conference and the SDK exposes only uiControls.main.endConsult—a supported shape already handled in task/src/helper.ts and its tests—this predicate incorrectly treats the consult as inactive because it inspects only uiControls.consult. Consequently getCurrentConsultMediaEntry omits the ringing or answering destination, while the identical predicate in hasActiveNonHeldConsult leaves Drop enabled for established participants during the active non-held consult; include the main-leg end-consult signal in both derivations.
Useful? React with 👍 / 👎.
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
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.