Backport saveNote ts/color IntegerString fixes to 24.05#7593
Open
ar2rsawseen wants to merge 2 commits into
Open
Backport saveNote ts/color IntegerString fixes to 24.05#7593ar2rsawseen wants to merge 2 commits into
ar2rsawseen wants to merge 2 commits into
Conversation
saveNote schema declared color as String but the dashboard (countly.common.notes.js COLOR_TAGS) sends a numeric index 1..5. Validation stayed dormant until H-5 started enforcing validateArgs, after which every create/edit failed with 'Invalid type for color'. Switched color to IntegerString so both Number (JSON body) and numeric string (URL query) are accepted. Slack context: https://countly.slack.com/archives/CV9KV4UQ1/p1779195915103949 Ports: Countly/countly-platform#280 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Backport of two master fixes to the 24.05 branch addressing saveNote schema validation regressions introduced by H-5 enforcement. The dashboard sends color as a numeric index and ts as a number, both of which were rejected by the newly enforced schema.
Changes:
- Change
tsfield type from empty string toIntegerStringinsaveNoteschema - Change
colorfield type fromStringtoIntegerStringto accept both numeric and string values - Add CHANGELOG entry under the 24.05.50 Security Fixes block
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| api/parts/mgmt/users.js | Updates saveNote schema types for ts and color to IntegerString |
| CHANGELOG.md | Documents the backport under the 24.05.50 Security Fixes block |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of two master commits that fix saveNote validation regressions introduced by H-5 (
saveNoteschema enforcement) in 24.05.50:b3f9d0ffix(notes): accept numeric color in saveNote schema (PR fix(notes): accept numeric color in saveNote schema #7578)0b6cea6Change 'ts' type from empty to 'IntegerString'Without these, every graph-note create/edit fails validation against the newly enforced schema because the dashboard sends
coloras a numeric index (1..5) andtsas a number.Conflict resolution
api/parts/mgmt/users.js: applied cleanly.CHANGELOG.md: master's25.03.Xheading replaced with a new entry under the existing24.05.50Security Fixes block (this is a follow-up to the H-5 fix listed there).Test plan
color: "abc",ts: "notanumber")🤖 Generated with Claude Code