Backport saveNote ts/color IntegerString fixes to feature/new-ui-dw#7594
Merged
Cookiezaurs merged 2 commits intoMay 25, 2026
Merged
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
This PR backports two upstream fixes onto feature/new-ui-dw to resolve saveNote validation regressions introduced when saveNote schema validation started being enforced (H-5). The goal is to allow the dashboard to create/edit graph notes successfully when it sends numeric ts and numeric color.
Changes:
- Update
saveNoteschema to validatetsasIntegerStringinstead of an empty/unenforced type. - Update
saveNoteschema to validatecolorasIntegerStringto accept numeric color indices (1..5). - Add a changelog entry documenting the
colorvalidation fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| CHANGELOG.md | Adds a release-note entry for the saveNote.color validation backport. |
| api/parts/mgmt/users.js | Adjusts saveNote validation schema for ts and color; minor formatting tweak at export. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cookiezaurs
approved these changes
May 25, 2026
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
Same two commits as the 24.05 backport in #7593, but cherry-picked directly onto
feature/new-ui-dwso the customer branch picks up the saveNote validation regression fixes: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'Background: H-5 (
saveNoteschema enforcement) was just merged into this branch via #7568. Without these follow-ups, graph note create/edit fails validation because the dashboard sends numericcolor(1..5) and numericts.Companion PR to release.24.05: #7593.
Conflict resolution
api/parts/mgmt/users.js: applied cleanly.CHANGELOG.md: master's25.03.Xheading replaced with an entry under the existing24.05.50Security Fixes block (this is a follow-up to the H-5 fix listed there).Test plan
color: "abc")🤖 Generated with Claude Code