Skip to content

Backport saveNote ts/color IntegerString fixes to 24.05#7593

Open
ar2rsawseen wants to merge 2 commits into
release.24.05from
backport/note-validation-ts-color-24.05
Open

Backport saveNote ts/color IntegerString fixes to 24.05#7593
ar2rsawseen wants to merge 2 commits into
release.24.05from
backport/note-validation-ts-color-24.05

Conversation

@ar2rsawseen
Copy link
Copy Markdown
Member

Summary

Backport of two master commits that fix saveNote validation regressions introduced by H-5 (saveNote schema enforcement) in 24.05.50:

Without these, every graph-note create/edit fails validation against the newly enforced schema because the dashboard sends color as a numeric index (1..5) and ts as a number.

Conflict resolution

  • api/parts/mgmt/users.js: applied cleanly.
  • CHANGELOG.md: master's 25.03.X heading replaced with a new entry under the existing 24.05.50 Security Fixes block (this is a follow-up to the H-5 fix listed there).

Test plan

  • Create a graph note from the dashboard — succeeds (previously failed with "Invalid type for color")
  • Edit an existing graph note — succeeds
  • Verify schema still rejects truly invalid color/ts payloads (e.g. color: "abc", ts: "notanumber")

🤖 Generated with Claude Code

davidecavaliere and others added 2 commits May 25, 2026 10:30
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>
Copilot AI review requested due to automatic review settings May 25, 2026 07:31
Copy link
Copy Markdown
Contributor

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

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 ts field type from empty string to IntegerString in saveNote schema
  • Change color field type from String to IntegerString to 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.

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.

4 participants