Skip to content

Conversation

@kkartunov
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-3207 and related issues.

What's in this PR?

kkartunov and others added 14 commits December 12, 2025 08:48
…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: kkartunov <5585002+kkartunov@users.noreply.github.com>
Fix ESLint semicolon violations in metadataMatching.ts
Potential fix for code scanning alert no. 71: Incomplete string escaping or encoding
Potential fix for code scanning alert no. 69: Incomplete string escaping or encoding
hotfix(PM-3208): add manager comment button showing to submitters and normal reviewer
Revert "fix(PM-2573): show only submissions with passed screening score"
@kkartunov kkartunov requested a review from jmgasper as a code owner December 12, 2025 11:54
)}

{!showCommentForm && !comment && isManagerEdit && (
{!showCommentForm && !comment && isManagerEdit && canAddManagerComment && (

Choose a reason for hiding this comment

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

[⚠️ correctness]
The addition of canAddManagerComment to the condition ensures that the button to add a manager comment is only shown when it is allowed. Verify that canAddManagerComment is correctly set in all contexts where this component is used to avoid unexpected behavior.

isAppealsTab: false,
}),
[],
[canRespondToAppeals],

Choose a reason for hiding this comment

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

[⚠️ performance]
The useMemo dependency array now includes canRespondToAppeals, which is correct for ensuring the memoized value updates when canRespondToAppeals changes. However, ensure that canRespondToAppeals is a stable value and doesn't change unnecessarily, as this could lead to unnecessary re-renders.

<Link
className={styles.respondButton}
to={getReviewRoute(submission.id, reviewId)}
to={getReviewRoute(submission.id, reviewId, canRespondToAppeals)}

Choose a reason for hiding this comment

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

[❗❗ correctness]
The addition of canRespondToAppeals as a parameter to getReviewRoute suggests that the route logic might change based on this flag. Ensure that this change is backward compatible and that all parts of the application using this route are updated accordingly to handle the new parameter.

...aggregated.submission,
aggregated,
})) as SubmissionRow[]
const rows = aggregatedSubmissionRows.map(aggregated => ({

Choose a reason for hiding this comment

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

[❗❗ correctness]
The filtering logic for myReviewDetail has been removed. This could lead to incorrect data being processed if the filtering was necessary to exclude certain submissions. Ensure that this change does not introduce any logical errors or unintended behavior.

const reviewUrl = getReviewUrl ? getReviewUrl(reviewId) : getReviewRoute(submission.id, reviewId)
const reviewUrl = getReviewUrl
? getReviewUrl(reviewId)
: getReviewRoute(submission.id, reviewId, canRespondToAppeals)

Choose a reason for hiding this comment

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

[❗❗ correctness]
The getReviewRoute function now takes an additional canRespondToAppeals parameter. Ensure that this function handles the new parameter correctly and that all usages of getReviewRoute are updated accordingly. This change could impact the correctness of the URL generation.

const reviewUrl = getReviewUrl ? getReviewUrl(reviewId) : getReviewRoute(submission.id, reviewId)
const reviewUrl = getReviewUrl
? getReviewUrl(reviewId)
: getReviewRoute(submission.id, reviewId, canRespondToAppeals)

Choose a reason for hiding this comment

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

[❗❗ correctness]
The getReviewRoute function now takes an additional canRespondToAppeals parameter. Ensure that this function handles the new parameter correctly and that all usages of getReviewRoute are updated accordingly. This change could impact the correctness of the URL generation.

const targetWithPlaceholder = target.replace(sepPattern, WORDSEP_PLACEHOLDER)
// Properly escape ALL regex metacharacters (including backslash), leaving the placeholder intact
const escapedTarget = escapeRegexLiteral(targetWithPlaceholder)
.replace(new RegExp(escapeRegexLiteral(WORDSEP_PLACEHOLDER), 'g'), '[-_\\s]+')

Choose a reason for hiding this comment

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

[⚠️ correctness]
The use of [-_\\s]+ to replace the placeholder could potentially match unintended sequences if the target string contains special characters that are not properly escaped. Consider reviewing the escapeRegexLiteral function to ensure it handles all edge cases, or explicitly document the expected input constraints.

export function getReviewRoute(
submissionId: string,
reviewId: string,
addRespondToAppeals?: boolean,

Choose a reason for hiding this comment

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

[💡 readability]
Consider renaming addRespondToAppeals to includeRespondToAppeals for clarity, as it better describes the boolean nature of the parameter.

@kkartunov kkartunov merged commit 95887b1 into master Dec 12, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants