Skip to content

fix(dashboards): accept note widgets regardless of apps value - #8099

Merged
shepardly[bot] merged 2 commits into
masterfrom
claude/note-widget-creation-bug-5cd6af
Oct 9, 2026
Merged

shepardly[bot] merged 2 commits into
masterfrom
claude/note-widget-creation-bug-5cd6af

Conversation

@Cookiezaurs

@Cookiezaurs Cookiezaurs commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Creating a note widget on a dashboard fails with 400 Invalid parameter: widget.apps.

Introduced by 2fe1cf4 (security(dashboards): scope copied widgets to the copier's app access), which validates widget.apps as a strict array of 24-char hex app ids. Notes are stored with apps: "*", so:

  • add-widget: creating a note is rejected
  • update-widget: editing a note is rejected
  • copy dashboard: notes are silently dropped from the copy

Fix

Notes show no app data. Whatever apps value arrives for a note is stored as "*" — the format notes have always had, so existing note widgets need no transformation when migrating. Notes are never rejected over apps and skip app id validation and access checks:

  • add-widget: apps set to "*" before isWidgetValid; validation/access check only for non-note widgets
  • update-widget: the note/data decision moved after the stored widget is read, so a partial update without widget_type is still recognised as a note via the stored type
  • copy: notes always copied, apps kept as "*"

Data widgets keep the strict validation and app access checks from 2fe1cf4 (a number widget with apps: "*" is still a 400).

Also: note contenthtml is sanitized on partial updates of stored notes, and a missing contenthtml on create no longer passes undefined to the sanitizer.

Tests

New Testing dashboards note widgets block in plugins/dashboards/tests.js: notes with "*", [], missing, null, string, array-like, invalid and unreadable ids are all accepted; edit with and without widget_type; stored note has apps: "*"; notes survive dashboard copy; data widget with "*" still rejected.

Not yet run locally — run npm run test:plugin -- dashboards.

🤖 Generated with Claude Code

Cookiezaurs and others added 2 commits October 8, 2026 18:18
2fe1cf4 made add-widget/update-widget validate widget.apps as a strict
array of app ids. The note widget UI sends apps: "*", so creating or editing
a note failed with 400 "Invalid parameter: widget.apps", and copying a
dashboard silently dropped its notes.

Notes show no app data, so whatever apps value arrives is now replaced with
[] before saving on create, update and copy. On update the stored widget
type is used when the request omits widget_type. Data widgets keep the
strict validation and access checks. The note UI now sends apps: [].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Notes have always been stored with apps: "*". Keep that format instead of
rewriting it to [], so existing note widgets need no transformation when
migrating. Whatever apps value arrives for a note is stored as "*" on
create, update and copy, and notes skip app id validation and access
checks. The note UI sends "*" again, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shepardly
shepardly Bot enabled auto-merge October 9, 2026 07:34
@shepardly
shepardly Bot merged commit cc3bce5 into master Oct 9, 2026
11 of 12 checks passed
@Cookiezaurs
Cookiezaurs deleted the claude/note-widget-creation-bug-5cd6af branch October 9, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants