Skip to content

Desktop: Fixes #12419: Ensure min and max validation is enforced when setting is not yet present #12553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 28, 2025

Conversation

mrjo118
Copy link
Contributor

@mrjo118 mrjo118 commented Jun 17, 2025

This PR fixes an issue whereby the min / max value validation is not enforced for integer type settings, when the value is not currently present in the settings.json file. Currently, the validation is only enforced if the setting has been changed before and therefor is present. This change fixes a gap in the validation logic, which will align the behaviour to be the same for insert and update of setting values. I have manually tested this resolves the issue, as well as adding a test unit

This fixes #12419

@@ -456,4 +456,18 @@ describe('models/Setting', () => {
await Setting.saveAll();
}
});

test('should enforce min and max values for when the setting is already in the cache and when it is not', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for adding a test!

@personalizedrefrigerator
Copy link
Collaborator

This looks good to me. Thank you for fixing this!

@laurent22 laurent22 merged commit 813f077 into laurent22:dev Jun 28, 2025
11 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.

Desktop: Integer configuration settings do not enforce min / max value validation on their very first change
3 participants