Skip to content

[PROD RELEASE] - Fix traits#57

Merged
kkartunov merged 3 commits intomasterfrom
develop
Feb 9, 2026
Merged

[PROD RELEASE] - Fix traits#57
kkartunov merged 3 commits intomasterfrom
develop

Conversation

@kkartunov
Copy link
Copy Markdown
Contributor

@kkartunov kkartunov changed the title [PROD RELEASE] [PROD RELEASE] - Fix traits Feb 9, 2026
if (_.includes(traitIds, 'personalization') &&
!_.isEmpty(traitData.personalization)
) {
const collectInfo = {}
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 collectInfo object is initialized outside the loop but is only used within the loop. Consider moving its declaration inside the loop to limit its scope and improve readability.

data: _.map(traitData.personalization, t => ({
[t.key]: t.value
}))
data: [collectInfo]
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 change from using _.map to constructing a single collectInfo object and wrapping it in an array could lead to different behavior if traitData.personalization contains multiple entries with the same key. The previous implementation would have created an array of objects, while the new implementation overwrites values for duplicate keys. Ensure this change is intentional and aligns with the desired functionality.

@kkartunov kkartunov merged commit b4bccb4 into master Feb 9, 2026
7 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.

2 participants