Skip to content

Comments

[PROD RELEASE] - Fixes & Updates#1476

Merged
kkartunov merged 18 commits intomasterfrom
dev
Feb 17, 2026
Merged

[PROD RELEASE] - Fixes & Updates#1476
kkartunov merged 18 commits intomasterfrom
dev

Conversation

@kkartunov
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/

What's in this PR?

@kkartunov kkartunov requested a review from jmgasper as a code owner February 16, 2026 08:03
setAiGenerationError(undefined)

try {
const result = await extractSkillsFromText(formValues.overview)

Choose a reason for hiding this comment

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

[⚠️ correctness]
Consider adding a check to ensure formValues.overview is not undefined or null before calling extractSkillsFromText. This will prevent potential runtime errors if formValues.overview is unexpectedly missing.


// Add extracted skills to existing skills (avoid duplicates)
const existingSkillIds = new Set((formValues.skills || []).map((s: any) => s.id))
const newSkills = result.matches.filter(skill => !existingSkillIds.has(skill.id))

Choose a reason for hiding this comment

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

[💡 maintainability]
The use of any for the type of formValues.skills and s could be replaced with a more specific type to improve type safety and maintainability.

`Successfully added ${newSkills.length} skill${newSkills.length > 1 ? 's' : ''} from AI analysis!`,
)
} catch (error) {
const errorMessage = (error as Error).message

Choose a reason for hiding this comment

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

[💡 maintainability]
Consider providing more context in the error message logged to the console. This can help with debugging by including additional information such as the formValues state or the specific input that caused the error.

// Check if overview has enough content for AI processing
const canGenerateSkills = useMemo(() => {
const overview = formValues.overview?.trim() || ''
return overview.length >= MIN_OVERVIEW_LENGTH && !isGeneratingSkills

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 includes formValues.overview, which is an object property. This could lead to unnecessary recalculations if formValues changes but overview does not. Consider extracting overview into a separate state or variable to avoid this.

className={classNames(
styles.phoneCardLeft,
props.phoneIndex !== 0 ? styles.phoneCardNotFirst : '',
!props.isModalView && props.phoneIndex !== 0 ? styles.phoneCardNotFirst : '',

Choose a reason for hiding this comment

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

[⚠️ correctness]
The condition !props.isModalView && props.phoneIndex !== 0 assumes that props.phoneIndex is always defined when !props.isModalView is true. Consider adding a default value for phoneIndex in PhoneCardProps or handling the case where phoneIndex might be undefined to avoid potential runtime errors.

'href', 'target', 'rel', 'style', 'align',
'border', 'cellpadding', 'cellspacing', 'colspan',
'rowspan', 'width', 'height', 'class',
'rowspan', 'width', 'height', 'class', 'type',

Choose a reason for hiding this comment

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

[❗❗ security]
Adding 'type' to ALLOWED_ATTR should be carefully considered, as it could introduce security risks if not properly sanitized. Ensure that only safe values are allowed for this attribute.


return runId
} catch (error) {
console.error('Failed to start workflow run:', (error as Error).message)

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Consider using a more specific error type or structure for logging and throwing errors to provide better context and handling downstream.


if (status === 'failed') {
const errorMsg = result?.error?.message || 'Workflow execution failed'
throw new Error(`Workflow failed: ${errorMsg}`)

Choose a reason for hiding this comment

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

[⚠️ maintainability]
The error message for a failed workflow could include more context, such as the workflow ID or run ID, to aid in debugging.

} catch (error) {
const errorMessage = (error as Error).message
// If it's a network error or timeout, try again
if (errorMessage.includes('timeout') || (error as any).code === 'ECONNABORTED') {

Choose a reason for hiding this comment

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

[⚠️ correctness]
Checking for network errors using error message strings may be fragile. Consider using error codes or a more robust error handling mechanism.

console.log('Workflow completed successfully')

return (result.result as SkillsExtractionResult) || {}
} catch (error) {

Choose a reason for hiding this comment

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

[⚠️ correctness]
Casting result.result to SkillsExtractionResult without checking its structure could lead to runtime errors if the API response changes. Consider validating the structure before casting.

@@ -1 +1,2 @@
export * from './ai-workflows'

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Using export * can lead to unexpected namespace collisions if there are overlapping exports between ./ai-workflows and ./standard-skills. Consider explicitly exporting only the necessary components to avoid potential conflicts and improve maintainability.

PM-3855 Enforce profile completeness for engagement application
.applyMessage {
display: flex;
flex-direction: column;
gap: $sp-3;

Choose a reason for hiding this comment

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

[❗❗ correctness]
The use of $sp-3 and $sp-4 for gap and padding respectively assumes these variables are defined and correctly set in the context of this stylesheet. Ensure these variables are defined and have appropriate values to avoid unexpected layout issues.

width: fit-content;
font-size: 16px;
font-weight: 600;
color: var(--tc-primary);

Choose a reason for hiding this comment

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

[❗❗ correctness]
The use of var(--tc-primary) for the color property assumes that this CSS variable is defined and available in the context where this class is used. Ensure that --tc-primary is defined to avoid rendering issues.


if (
profileCompleteness
&& typeof profileCompleteness.percent === 'number'

Choose a reason for hiding this comment

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

[⚠️ correctness]
The check for profileCompleteness.percent < 100 assumes that percent is always a number when profileCompleteness is defined. Consider adding a check to ensure percent is a valid number to avoid potential runtime errors.

</span>
<a
className={styles.signInLink}
href={`${EnvironmentConfig.URLS.USER_PROFILE}/${profileHandle}`}

Choose a reason for hiding this comment

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

[⚠️ correctness]
The URL for updating the profile is constructed using profileHandle, which is derived from profileContext.profile?.handle. Ensure that profileHandle is always defined when this link is rendered to avoid potential issues with undefined URLs.

const existingSkillIds = new Set((formValues.skills || []).map((s: any) => s.id))
const newSkills = result.matches
.filter(skill => !existingSkillIds.has(skill.id))
.map(skill => pick(skill, ['id', 'name']))

Choose a reason for hiding this comment

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

[⚠️ correctness]
Using pick from lodash to select specific fields from skill is a good approach to ensure only the necessary data is included. However, ensure that skill always contains the id and name properties to avoid potential runtime errors. Consider adding a type check or validation if this is not guaranteed.

background: #fff;
border: 1px solid #e5e7eb;
border-radius: 16px;
box-shadow: 0 24px 64px $tc-black;

Choose a reason for hiding this comment

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

[❗❗ correctness]
The box-shadow property uses a variable $tc-black, which is not defined in the provided context. Ensure that this variable is defined elsewhere in the codebase to avoid potential issues with the styling.

.backdrop {
position: absolute;
inset: 0;
background: var(--text-secondary);

Choose a reason for hiding this comment

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

[⚠️ correctness]
The background color for .backdrop uses a CSS variable --text-secondary. Ensure that this variable is defined and has the intended value, as missing or incorrect variable definitions can lead to unexpected styling.


const isMobile: boolean = useCheckIsMobile()

const closePopover = useCallback(() => {

Choose a reason for hiding this comment

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

[⚠️ performance]
The useCheckIsMobile hook is used to determine if the device is mobile. Ensure that this hook is efficient and does not cause unnecessary re-renders, as it is used in a useCallback dependency array.

const dateKey = e.currentTarget.dataset.dateKey
if (!dateKey) return

setOpenDateKey(prev => (prev === dateKey ? undefined : dateKey))

Choose a reason for hiding this comment

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

[⚠️ correctness]
The setOpenDateKey function toggles the state based on the previous value. Consider using a functional update to ensure the state update is based on the latest state, which is more reliable in concurrent rendering scenarios.


return (
<div className={styles.modalRoot}>
<div className={styles.backdrop} onClick={closePopover} />

Choose a reason for hiding this comment

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

[💡 design]
The backdrop div for closing the popover uses an onClick handler. Ensure that this does not interfere with other click events or cause unexpected behavior, especially in complex UI interactions.

hentrymartin and others added 2 commits February 16, 2026 19:10
fix(PM-2662): allow submissions to be visible in winners tab if submissionsViewable is configured to true
}),
[loginUserInfo?.roles, loginUserInfo?.userId, myRoles],
)
const challengeVisibility = useMemo<ChallengeVisibilityFlags | undefined>(

Choose a reason for hiding this comment

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

[❗❗ correctness]
The useMemo hook is used to memoize challengeVisibility, but the dependencies array includes challengeInfo?.track?.name, challengeInfo?.status, and challengeInfo?.metadata. If challengeInfo is undefined, these dependencies will not trigger a recomputation when challengeInfo becomes defined. Consider adding challengeInfo itself as a dependency to ensure the memoized value updates correctly when challengeInfo changes from undefined to a defined object.

const isDesign = trackName === 'design'
const isCompleted = status === 'completed'
const submissionsViewable = Boolean(
challengeInfo.metadata?.some(

Choose a reason for hiding this comment

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

[❗❗ correctness]
The some method is used to determine if submissionsViewable is true in the metadata. If challengeInfo.metadata is undefined, this could result in a runtime error. Consider using optional chaining (challengeInfo.metadata?.some(...)) to prevent potential errors.

hasSubmitterRole
&& !canViewAllSubmissions,
&& !canViewAllSubmissions
&& !allowViewAllSubmissionsForDesign,

Choose a reason for hiding this comment

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

[❗❗ correctness]
The logic for shouldRestrictToCurrentMember now includes !allowViewAllSubmissionsForDesign. Ensure that this change aligns with the intended access control logic, as it modifies who can view submissions.

@kkartunov kkartunov changed the title [PROD NO MERGE] [PROD RELEASE] - Fixes & Updates Feb 17, 2026
@kkartunov kkartunov merged commit 370d925 into master Feb 17, 2026
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.

4 participants