Skip to content

Backport saveNote ts/color IntegerString fixes to feature/new-ui-dw#7594

Merged
Cookiezaurs merged 2 commits into
feature/new-ui-dwfrom
backport/note-validation-ts-color-new-ui-dw
May 25, 2026
Merged

Backport saveNote ts/color IntegerString fixes to feature/new-ui-dw#7594
Cookiezaurs merged 2 commits into
feature/new-ui-dwfrom
backport/note-validation-ts-color-new-ui-dw

Conversation

@ar2rsawseen
Copy link
Copy Markdown
Member

Summary

Same two commits as the 24.05 backport in #7593, but cherry-picked directly onto feature/new-ui-dw so the customer branch picks up the saveNote validation regression fixes:

Background: H-5 (saveNote schema enforcement) was just merged into this branch via #7568. Without these follow-ups, graph note create/edit fails validation because the dashboard sends numeric color (1..5) and numeric ts.

Companion PR to release.24.05: #7593.

Conflict resolution

  • api/parts/mgmt/users.js: applied cleanly.
  • CHANGELOG.md: master's 25.03.X heading replaced with an 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
  • Edit an existing graph note — succeeds
  • Schema still rejects truly invalid color/ts payloads (e.g. color: "abc")

🤖 Generated with Claude Code

davidecavaliere and others added 2 commits May 25, 2026 10:32
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:33
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

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 saveNote schema to validate ts as IntegerString instead of an empty/unenforced type.
  • Update saveNote schema to validate color as IntegerString to accept numeric color indices (1..5).
  • Add a changelog entry documenting the color validation 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.

Comment thread api/parts/mgmt/users.js
Comment thread api/parts/mgmt/users.js
Comment thread CHANGELOG.md
@Cookiezaurs Cookiezaurs merged commit 526c1bf into feature/new-ui-dw May 25, 2026
1 of 2 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.

4 participants