Skip to content

fix: stop ticket edits from clearing the assignee - #78

Draft
sonnymay wants to merge 1 commit into
mainfrom
claude/vibrant-meitner-ogm4a5
Draft

sonnymay wants to merge 1 commit into
mainfrom
claude/vibrant-meitner-ogm4a5

Conversation

@sonnymay

Copy link
Copy Markdown
Owner

Summary

PUT /tickets/{id} used model_dump() on the full Ticket model. Any field the client left out was filled with its default and written by the PATCH. The Tickets page edit form has no assignee input, so every ticket edit from the UI set assigned_user_id to NULL, and the assignee was lost without any error.

update_ticket now PATCHes only the fields that are in the request (model_dump(exclude_unset=True)). It writes a ticket_history row only when the request includes a status. Blank id fields are still converted to NULL. Other routes are unchanged because their forms send every field.

I checked all open PRs (#17–#77) and searched issues and PRs: none fix this. #76 and #74 touch the same clean_empty_strings call in update_ticket, and #45, #47, #72 and #77 edit the same function. Small merge conflicts are possible, but none of them change which fields get written.

Testing

  • Added test_update_ticket_only_patches_fields_sent_by_client (sends the Tickets page form payload and checks assigned_user_id is not in the PATCH) and test_update_ticket_without_status_skips_history. Both fail without the fix.
  • pytest: 45 passed, with dummy SUPABASE_URL/SUPABASE_KEY. ruff check, ruff format --check and mypy . are clean.

Generated by Claude Code

PUT /tickets/{id} dumped the full Ticket model, so any field the client
omitted was filled with its default and written by the PATCH. The Tickets
page edit form has no assignee input, so every edit from the UI silently
set assigned_user_id to NULL.

update_ticket now PATCHes only the fields present in the request
(model_dump(exclude_unset=True)), and writes status history only when the
request includes a status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171zWzmk8ywmS3JeGFiZq3C
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
supportops Ready Ready Preview Nov 26, 2026 3:04pm UTC

This branch was successfully deployed

1 active deployment
Preview — cd1045ee Deployed Nov 26, 2026 by vercel[bot]
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