Repository navigation
[PAI-2144] fix: name the field errors in a v2 error's message - #67
Merged
akhil-vamshi-konam merged 1 commit intoNov 18, 2026
Merged
Conversation
|
Caution Review failedThe pull request is closed.
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. |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
akhil-vamshi-konam
force-pushed
the
fix/pai-2144-v2-error-field-messages
branch
from
November 18, 2026 15:09
431c683 to
c039937
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
HTTP 400 invalid_request: One or more fields failed validation.; the reason sat inPlaneApiError.errors, which callers that printmessagenever show.... One or more fields failed validation. (role: Invalid role. Must be one of: ['admin', 'contributor', 'guest', 'member']).errors,status,codeanddetailare unchanged; errors without field messages keep the old text.Where to look
src/errors/PlaneApiError.ts— message assemblytests/unit/v2/errors.test.ts— 2 testsProof
Important
Confidence: High — unit tests plus a live before/after against a local Plane API
pnpm check:types,check:lint,check:format,build: pass;jest tests/unit: pass. Live: a v2 project member create with an invalid role — onmainthe message has no reason, on this branch it ends with(role: ...); a plain 404's message is unchangedRollout
Links