Skip to content

fix: creating a board without a description returns 500 - #4469

Open
brantsrasmus wants to merge 1 commit into
umami-software:devfrom
brantsrasmus:fix/board-create-description
Open

fix: creating a board without a description returns 500#4469
brantsrasmus wants to merge 1 commit into
umami-software:devfrom
brantsrasmus:fix/board-create-description

Conversation

@brantsrasmus

@brantsrasmus brantsrasmus commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Problem

POST /api/boards returns 500 when description is omitted. The request schema marks it .optional(), but board.description is VARCHAR(500) NOT NULL with no default, so it reaches Prisma as undefined:

Invalid `prisma.board.create()` invocation
Argument `description` is missing.

The UI always sends a description, so this only bites API clients — I hit it writing an API test.

Fix

Default it to an empty string in the create route, matching what the UI sends today. No schema change, no migration.

Test

tests/e2e/api-board.spec.ts creates a board with { name, type } only and asserts 200 plus description: ''. Verified it fails (500) without the one-line change and passes with it.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

`description` is optional in the request schema, but the column is
NOT NULL with no default, so an omitted description reached Prisma as
undefined and the create threw a validation error instead of saving:

    Invalid `prisma.board.create()` invocation
    Argument `description` is missing.

Default it to an empty string, matching what the UI sends today, and
cover it with an API test.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

@brantsrasmus is attempting to deploy a commit to the Umami Software Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 107e24ef-98e7-4d4c-b73f-84d5d30de939

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents board creation from failing when API clients omit the optional description.

  • Defaults omitted board descriptions to an empty string before Prisma persistence.
  • Adds API regression coverage for creation without a description.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The fallback applies only when description is omitted, preserves valid supplied strings, matches existing UI behavior, and is covered by an API regression test.

Important Files Changed

Filename Overview
src/app/api/boards/route.ts Correctly aligns the optional request field with the required database column by defaulting only omitted descriptions.
tests/e2e/api-board.spec.ts Adds discoverable Playwright coverage that verifies the successful response and persisted empty description.

Reviews (1): Last reviewed commit: "fix: creating a board without a descript..." | Re-trigger Greptile

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