Skip to content

fix(notes): accept numeric color in saveNote schema#7578

Merged
Cookiezaurs merged 2 commits into
masterfrom
fix/note_validation_ts
May 19, 2026
Merged

fix(notes): accept numeric color in saveNote schema#7578
Cookiezaurs merged 2 commits into
masterfrom
fix/note_validation_ts

Conversation

@davidecavaliere
Copy link
Copy Markdown
Contributor

Summary

  • 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.
  • Added a [core] entry under 25.03.X in CHANGELOG.

Slack context: https://countly.slack.com/archives/CV9KV4UQ1/p1779195915103949
Ports: Countly/countly-platform#280

Test plan

  • Create a graph note from the dashboard → 200 Success (was 400 'Invalid type for color')
  • Edit an existing graph note → 200 Success
  • Direct API call with color: 5 (number) succeeds
  • Direct API call with color: "5" (string) still succeeds

🤖 Generated with Claude Code

davidecavaliere and others added 2 commits May 19, 2026 18:12
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>
@Cookiezaurs Cookiezaurs enabled auto-merge May 19, 2026 16:37
@Cookiezaurs Cookiezaurs merged commit 6e9b629 into master May 19, 2026
10 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