Skip to content

[PAI-2144] fix: name the field errors in a v2 error's message - #67

Merged
akhil-vamshi-konam merged 1 commit into
release-0.3.2from
fix/pai-2144-v2-error-field-messages
Nov 18, 2026
Merged

akhil-vamshi-konam merged 1 commit into
release-0.3.2from
fix/pai-2144-v2-error-field-messages

Conversation

@akhil-vamshi-konam

Copy link
Copy Markdown
Contributor

What

  • Was: every v2 refusal read only HTTP 400 invalid_request: One or more fields failed validation.; the reason sat in PlaneApiError.errors, which callers that print message never show.
  • Now: the message ends with the field messages, e.g. ... One or more fields failed validation. (role: Invalid role. Must be one of: ['admin', 'contributor', 'guest', 'member']).
  • errors, status, code and detail are unchanged; errors without field messages keep the old text.

Where to look

  1. 🔴 src/errors/PlaneApiError.ts — message assembly
  2. ⚪ tests/unit/v2/errors.test.ts — 2 tests

Proof

Important

Confidence: High — unit tests plus a live before/after against a local Plane API

  • Ran: pnpm check:types, check:lint, check:format, build: pass; jest tests/unit: pass. Live: a v2 project member create with an invalid role — on main the message has no reason, on this branch it ends with (role: ...); a plain 404's message is unchanged
  • Not verified: None

Rollout

  • None. Code that matches the exact old message text sees a longer string.

Links

  • Work item: PAI-2144

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@makeplane

makeplane Bot commented Nov 18, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@akhil-vamshi-konam
akhil-vamshi-konam force-pushed the fix/pai-2144-v2-error-field-messages branch from 431c683 to c039937 Compare November 18, 2026 15:09
@akhil-vamshi-konam
akhil-vamshi-konam changed the base branch from main to release-0.3.2 November 18, 2026 15:09
@akhil-vamshi-konam
akhil-vamshi-konam merged commit 9e94afd into release-0.3.2 Nov 18, 2026
1 of 2 checks passed
@akhil-vamshi-konam
akhil-vamshi-konam deleted the fix/pai-2144-v2-error-field-messages branch November 18, 2026 15:09
Prashant-Surya pushed a commit that referenced this pull request Nov 24, 2026
* fix: name the field errors in a v2 error's message (#67)

* [PAI-2083] feat: dashboards and dashboard widgets on the v2 client (#61)

* [WEB-7851] feat: dashboards and dashboard widgets on the v2 client

Adds client.v2.workspaces.dashboards and its .widgets child for the new
/api/v2/workspaces/{slug}/dashboards/ endpoints.

- Dashboards: list, iterate, retrieve, create, update, delete, copy and
  widgetTypes. Rows come back as LoadedDashboard, which reaches
  dashboard.widgets with no ids repeated; a loaded workspace reaches
  workspace.dashboards. Every fields-taking method narrows its return type.
- Widgets: CRUD plus chart() (page, column_page, row_ids) and charts()
  (every widget's first page in one call, per-widget status/error).
- Models: Dashboard, Widget, their create/update/copy bodies, chart types,
  chart models, WidgetChart and WidgetChartResult.
- Generated constants regenerated from the golden the SDK was built on
  (plane-ee a8a1a9f43be) plus only the dashboards paths; additions only.
- Unit tests (nock), a live e2e suite, and the types-bundle snapshot.

* [WEB-7851] fix: empty widget_ids short-circuit, free-text widget fields, filter docs

- charts({ widget_ids: [] }) resolves to [] without a request; `?widget_ids=`
  used to chart every widget.
- Widget read model: last_used_filter, x_axis_date_grouping and y_axis_metric
  are string | null (the server stores free text, "" included). Create/update
  bodies keep the literal unions.
- TSDoc: charts() fails per widget for 400/402 but still rejects for errors
  about the dashboard itself; charts never read rich_filters; last_used_filter
  defaults to rich_filters and a pql-only create switches to pql_filters;
  changing a dashboard's access needs its owner; UpdateWidget takes null to
  clear the axis fields; the chart field is `schema` (Python: chart_schema).
- Unit tests: empty widget_ids, pql-only widget create, null-clearing update,
  table paging with page/column_page.
- Types-bundle snapshot updated for the Widget shape change.

* [WEB-7851] docs: charts() per-widget errors include server errors

* [WEB-7851] fix: review follow-ups on dashboards and widgets

- e2e: dashboard cleanup logs a failed delete instead of swallowing it, like the project cleanup
- WidgetChartResult.status: 200 or the error status (400, 402, 500, ...)
- StoredWidgetChartType: note the list can grow on the server; handle an unknown value
- Dashboard.access reads as number (older rows can carry the retired 2); writes keep 0 | 1

* [WEB-7851] fix: deep-review findings on dashboards and widgets

- row_ids takes the table's null row ((string | null)[]); documents that row paging fields only
  echo the request when row_ids is sent
- WidgetChartResult.error is the server's actual problem shape (type, code, detail, errors)
- DashboardPqlFilters: send stripped (json optional); raw is gone, nothing on the server reads it
- the pql-only auto-switch happens on update too, and can turn a rich-filter widget's filters off
- 404 vs 403 described accurately; access default, admin rule and member removal on going public;
  copy copies older dashboards as stored; charts() documents the 50-widget cap
- e2e cleanup no longer warns after a test deletes its own dashboard
- tests: null row in row_ids, row_ids [], chart error rejects with PlaneApiError, charts() with no
  widget_ids, widgets.iterate

* feat: change a workspace member's role (v1 and v2) (#66)

* [PAI-2161] feat(v2): work item subscribers (#70)

* [PAI-2161] feat(v2): work item subscribers

Read a work item's subscribers and add or remove them, by project and id (workItems.subscribers) or by identifier (workspaces.workItems.*SubscribersByIdentifier), and from a loaded work item. The four operation ids are added to the generated constants by hand; regenerating pulls unrelated drift.

* [PAI-2161] test(v2): work item subscribers

---------

Co-authored-by: gurusainath <gurusainath007@gmail.com>
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.

1 participant