Skip to content

fix: remove capacity requirement from user-facing workshop proposal schema#356

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-workshop-proposal-update
Open

fix: remove capacity requirement from user-facing workshop proposal schema#356
Copilot wants to merge 2 commits intomainfrom
copilot/fix-workshop-proposal-update

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

ProposalInputSchema enforced capacity for workshop formats server-side, but ProposalDetailsForm had no capacity input field — leaving speakers stuck in an unresolvable validation error when updating workshop proposals.

Capacity is an organizer concern (room size, registration limits), not a speaker concern. It's already manageable via updateWorkshopCapacitySchema in the admin layer.

Changes

  • src/server/schemas/proposal.ts — removed capacity .refine() from ProposalInputSchema; ProposalAdminCreateSchema is unchanged (admins can still set capacity at creation time)
  • src/lib/proposal/validation.ts — removed CAPACITY_REQUIRED message, ProposalValidationOptions interface, and the capacity check from validateProposalForm
  • Tests — updated schemas.test.ts (replaced "requires capacity" with "accepts workshop without capacity") and removed obsolete capacity tests from validation.test.ts

Before:

export const ProposalInputSchema = ProposalInputBaseSchema.refine(
  (data) => {
    if (isWorkshopFormat(data.format) && !data.capacity) return false
    return true
  },
  { message: 'Workshop capacity is required for workshop formats', path: ['capacity'] },
).refine(/* prerequisites check */)

After:

export const ProposalInputSchema = ProposalInputBaseSchema.refine(
  /* prerequisites check only */
)
Original prompt

This section details on the original issue you should resolve

<issue_title>Workshop proposals cannot be updated</issue_title>
<issue_description>## Bug Report

Description

When editing a workshop format proposal at /cfp/proposal?id=<ID> and clicking Update, the submission fails with:

Submission failed. Please fix the following: Workshop capacity is required for workshop formats.

However, there is no input field in the proposal form where a submitter can enter a workshop capacity — making it impossible to resolve the error and save changes.

Steps to Reproduce

  1. Submit a CFP proposal with the Workshop format.
  2. Navigate to /cfp/proposal?id=<YOUR_PROPOSAL_ID>.
  3. Make any change (or none) and click Update.
  4. Observe the validation error.

Expected Behavior

Editing a workshop proposal should either:

  • Provide a Workshop capacity input field so the user can supply a value, or
  • Not require capacity from the submitter at all (e.g., if this is something organizers configure rather than speakers).

Actual Behavior

A server-side validation in ProposalInputSchema requires capacity for workshop formats, but ProposalDetailsForm has no corresponding UI field — leaving the user stuck in an unresolvable error state.

Root Cause

src/server/schemas/proposal.ts enforces capacity on workshop proposals:

if (isWorkshopFormat(data.format) && !data.capacity) {
  return false // "Workshop capacity is required for workshop formats"
}

But no capacity field is rendered in ProposalDetailsForm.

Suggested Fix

If workshop capacity is an organizer concern (not a speaker concern), remove the capacity requirement from ProposalInputSchema and handle it separately in the admin interface. If it should be speaker-facing,
add a numeric input field to ProposalDetailsForm that is conditionally shown for workshop formats.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Greptile Summary

Correctly removes the speaker-facing capacity requirement for workshop proposals, resolving the issue where speakers couldn't update workshops due to a missing form field.

Key Changes:

  • Removed capacity .refine() validation from ProposalInputSchema — speakers no longer blocked by capacity requirement
  • Preserved capacity enforcement in ProposalAdminCreateSchema — admins can still set capacity at creation
  • Cleaned up client-side validation by removing capacity checks from validateProposalForm
  • Updated tests to reflect that workshops are now valid with or without capacity

How It Works:
Workshop queries already use coalesce(capacity, 30) fallback logic, so workshops without capacity default to 30 slots when displayed. Admins can set explicit capacity via updateWorkshopCapacitySchema.

Verified:

  • Schema separation is correct (user vs admin)
  • Existing workshop display logic already handles missing capacity
  • All test coverage updated appropriately

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are well-scoped, thoroughly tested, and correctly address the reported bug. The schema separation between user-facing and admin schemas is appropriate, validation logic is simplified, and all tests have been updated. The existing codebase already handles missing capacity values via coalesce() defaults in queries.
  • No files require special attention

Important Files Changed

Filename Overview
src/server/schemas/proposal.ts Removed capacity requirement from ProposalInputSchema; admin schema unchanged and still enforces capacity for workshop formats
src/lib/proposal/validation.ts Removed capacity validation logic and ProposalValidationOptions interface; validation now simplified

Last reviewed commit: 766b7ca

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cloudnativedays Ready Ready Preview, Comment Feb 28, 2026 4:26pm

Request Review

Copilot AI changed the title [WIP] Fix workshop proposals update validation error fix: remove capacity requirement from user-facing workshop proposal schema Feb 28, 2026
@Starefossen Starefossen requested a review from Copilot February 28, 2026 20:46
@Starefossen Starefossen marked this pull request as ready for review February 28, 2026 20:46
@Starefossen Starefossen requested a review from a team as a code owner February 28, 2026 20:46
Copy link
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

Removes the speaker-facing “workshop capacity required” validation that prevented workshop proposals from being updated via the CFP form, while keeping capacity management in the admin layer.

Changes:

  • Removed the capacity requirement refine from ProposalInputSchema (speaker create/update validation).
  • Simplified client-side proposal validation by removing the capacity-specific message/options and checks.
  • Updated tests to reflect that workshops can be valid without capacity in the speaker schema/validator.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/server/schemas/proposal.ts Drops workshop-capacity requirement from the user-facing proposal input schema (keeps admin create requirement).
src/lib/proposal/validation.ts Removes capacity-related validation message/options and the capacity check from validateProposalForm.
__tests__/lib/proposal/validation.test.ts Removes now-obsolete capacity validation tests.
__tests__/lib/proposal/schemas.test.ts Updates strict schema tests to allow workshops without capacity.
Comments suppressed due to low confidence (1)

src/server/schemas/proposal.ts:83

  • ProposalInputSchema no longer requires capacity (good for unblocking speakers), but it still accepts capacity because it’s part of ProposalInputBaseSchema. Since the PR description states capacity is organizer/admin-managed, a speaker could still set/overwrite capacity by crafting a request that passes this schema. Consider omitting capacity from the user-facing schema (or explicitly rejecting it) and/or stripping it server-side before persisting updates so only admin routes can change it.
export const ProposalInputSchema = ProposalInputBaseSchema.refine(
  (data) => {
    // Prerequisites should only be provided for workshop formats
    if (data.prerequisites && !isWorkshopFormat(data.format)) {
      return false
    }
    return true
  },
  {
    message: 'Prerequisites are only allowed for workshop formats',
    path: ['prerequisites'],
  },
)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Workshop proposals cannot be updated

3 participants