Skip to content

[PROD RELEASE] - Updates & fixes#93

Merged
kkartunov merged 10 commits intomasterfrom
develop
Mar 5, 2026
Merged

[PROD RELEASE] - Updates & fixes#93
kkartunov merged 10 commits intomasterfrom
develop

Conversation

@kkartunov
Copy link
Copy Markdown
Contributor

@kkartunov kkartunov commented Mar 5, 2026

Comment thread config/default.js
LIST_FETCH_COUNT: process.env.MAILCHIMP_LIST_FETCH_COUNT ? Number(process.env.MAILCHIMP_LIST_FETCH_COUNT) : 1000
}
},
PDF_SKILLS_PER_CATEGORY: process.env.PDF_SKILLS_PER_CATEGORY ? Number(process.env.PDF_SKILLS_PER_CATEGORY) : 5,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ correctness]
Consider using parseInt with a radix of 10 instead of Number for parsing process.env.PDF_SKILLS_PER_CATEGORY. This ensures that the conversion is always done in base 10, which can prevent unexpected results if the environment variable is prefixed with a non-decimal number.

* Create one category line in same style as verified/not verified: bullet label + skills on same line
*/
function createCategorySkillsBlock (categoryName, skillNames) {
if (!skillNames || skillNames.length === 0) return null
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[💡 readability]
The check !skillNames || skillNames.length === 0 is redundant since skillNames.length === 0 will suffice to check for an empty array. Consider simplifying the condition to if (skillNames.length === 0) return null.

*/
function buildProfileTemplate (pdfData) {
const { member, workExperience, education, languages, basicInfo, skills, topcoderActivity, certifications, courses } = pdfData
const { member, workExperience, education, languages, basicInfo, skills, skillsByCategory, topcoderActivity, certifications, courses } = pdfData
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ correctness]
The destructuring of pdfData now includes skillsByCategory. Ensure that this property is always present in the pdfData object to avoid potential runtime errors if it is undefined.

if (principalSubsection) {
skillsContent.push(principalSubsection)
const hasPrincipalSkills = skills && skills.principal && (skills.principal.verified.length > 0 || skills.principal.notVerified.length > 0)
const hasAdditionalByCategory = skillsByCategory && skillsByCategory.length > 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ correctness]
The condition skillsByCategory && skillsByCategory.length > 0 is used to check for additional skills by category. Ensure that skillsByCategory is always an array to avoid potential runtime errors.

// Avoid getting the member stats, since we don't need them here, and performance is
// better without them
const memberFields = { 'fields': 'userId,handle,handleLower,photoURL,description,skills,verified,availableForGigs,availableForGigsLastUpdateDate,lastProfileConfirmationDate,updatedAt,addresses' }
const memberFields = { 'fields': 'userId,handle,handleLower,photoURL,description,skills,verified,lastProfileConfirmationDate,updatedAt,addresses' }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ correctness]
The removal of availableForGigs and availableForGigsLastUpdateDate from memberFields might impact other parts of the code that rely on these fields. Ensure that these fields are not required elsewhere in the application logic.

data.gigAvailabilityLastUpdateDate = member.availableForGigsLastUpdateDate || undefined
}

_.forEach(memberTraits, (item) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ correctness]
The removal of the if block checking member.availableForGigs may affect the completeness calculation logic. Verify that this change aligns with the intended behavior and does not omit necessary checks.

principal: principalSkills,
additional: additionalSkills
},
skills: { principal: principalSkills },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ maintainability]
The restructuring of skills into skillsByCategory without retaining the additionalSkills object may affect any logic that previously relied on additionalSkills. Ensure that this change is consistent with the rest of the application and that no functionality is lost.

@kkartunov kkartunov merged commit 9fb95e3 into master Mar 5, 2026
7 of 8 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