[Bug] POST /api/campaigns accepts eight fields it silently drops #743

Closed
opened 2026-09-22 04:25:15 +00:00 by claude-bot · 1 comment
Collaborator

Found while writing the journeys harness's seed (#726, 2026-09-22).

CampaignCreate (webapp/backend/app/schemas/campaign.py:97) declares guild_id, notification_channel_id, vote_notification_mode, vote_auto_close_hours, recap_email_enabled, journal_entry_enabled, narrative_style and transcription_language, so a create request carrying them is accepted with 201. But campaign_service.create_campaign (webapp/backend/app/services/campaign_service.py:162-182) copies only the name, game system, description, webhook, timezone and reminder offsets. A create that looks like it connected Discord leaves the campaign with no guild, and nothing says so.

Either honour the fields on create (the same code path a later PATCH uses) or take them out of CampaignCreate so the request is refused with a 422 that names them. The seed works around it by creating then patching.

Labels: backend, bug.

Found while writing the journeys harness's seed (#726, 2026-09-22). `CampaignCreate` (`webapp/backend/app/schemas/campaign.py:97`) declares `guild_id`, `notification_channel_id`, `vote_notification_mode`, `vote_auto_close_hours`, `recap_email_enabled`, `journal_entry_enabled`, `narrative_style` and `transcription_language`, so a create request carrying them is accepted with 201. But `campaign_service.create_campaign` (`webapp/backend/app/services/campaign_service.py:162-182`) copies only the name, game system, description, webhook, timezone and reminder offsets. A create that looks like it connected Discord leaves the campaign with no guild, and nothing says so. Either honour the fields on create (the same code path a later `PATCH` uses) or take them out of `CampaignCreate` so the request is refused with a 422 that names them. The seed works around it by creating then patching. Labels: backend, bug.
Author
Collaborator

Fixed in #748, merged on green CI: create_campaign now honours the eight fields CampaignCreate already declared and validated, through the same validators PATCH uses, instead of silently dropping them. Covered by tests in tests/test_campaign_templates.py.

Fixed in #748, merged on green CI: `create_campaign` now honours the eight fields `CampaignCreate` already declared and validated, through the same validators `PATCH` uses, instead of silently dropping them. Covered by tests in `tests/test_campaign_templates.py`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#743
No description provided.