Skip to content

fixed side effect in attribute validation#351

Merged
SteRiccio merged 1 commit intomasterfrom
fix/attribute-validator-side-effect
Apr 8, 2026
Merged

fixed side effect in attribute validation#351
SteRiccio merged 1 commit intomasterfrom
fix/attribute-validator-side-effect

Conversation

@SteRiccio
Copy link
Copy Markdown
Member

No description provided.

@SteRiccio SteRiccio self-assigned this Apr 8, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@SteRiccio SteRiccio merged commit 4e24683 into master Apr 8, 2026
6 checks passed
@SteRiccio SteRiccio deleted the fix/attribute-validator-side-effect branch April 8, 2026 21:10
@SteRiccio SteRiccio requested a review from Copilot April 8, 2026 21:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an unintended side effect in attribute validation message construction by preventing mutation of the underlying expression.messages object while still ensuring default messages are filled in for all survey languages.

Changes:

  • Clone expression.messages before populating defaults to avoid mutating shared state.
  • Use Surveys.getLanguages(survey) instead of reading survey.props.languages directly.
  • Compute defaultMessageDefined once to avoid repeated emptiness checks inside the loop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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