Conversation
| status, | ||
| }, | ||
| await Promise.all( | ||
| escalations.map(escalation => updateAiReviewEscalation( |
There was a problem hiding this comment.
[correctness]
Using Promise.all to handle multiple asynchronous operations is generally fine, but be aware that if any of the promises reject, the entire Promise.all will reject. Consider handling individual promise rejections if partial success is acceptable or if you need to log specific errors.
| submission: SubmissionReviewerRow | ||
| decision: AiReviewEscalationDecision | ||
| escalation: AiReviewDecisionEscalation | ||
| escalations: AiReviewDecisionEscalation[] |
There was a problem hiding this comment.
[❗❗ correctness]
The change from escalation to escalations implies a shift from handling a single escalation to potentially handling multiple. Ensure that all parts of the code that interact with verifyTarget are updated to handle an array of escalations, especially if any logic assumes a single escalation.
| } | ||
|
|
||
| const pendingEscalation = decision.escalations.find(escalation => ( | ||
| const pendingEscalations = decision.escalations.filter(escalation => ( |
There was a problem hiding this comment.
[❗❗ correctness]
The change from find to filter means pendingEscalations is now an array. Ensure that all subsequent logic correctly handles this array, especially in places where a single escalation was expected.
| setVerifyTarget({ | ||
| decision, | ||
| escalation: pendingEscalation, | ||
| escalations: pendingEscalations, |
There was a problem hiding this comment.
[❗❗ correctness]
The setVerifyTarget function now sets escalations as an array. Ensure that any logic that processes verifyTarget.escalations is updated to handle multiple escalations, as previous logic might have assumed a single escalation.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-4364
What's in this PR?