fix(api): replace issue assignees and labels atomically#364
fix(api): replace issue assignees and labels atomically#364cavidelizade wants to merge 1 commit into
Conversation
ReplaceAssignees and ReplaceLabels did a clear-then-insert loop with no transaction, so a failed insert (or a duplicate id in the input hitting the unique constraint) left the issue with all prior rows deleted and only some new ones written. Create/Update call these and ignored the error, so the partial write went unreported. Move the clear-and-insert into store methods that run in one transaction and de-dupe the input (mirrors ModuleStore.SetMembers), so it either fully applies or rolls back. Closes Devlaner#341 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
ReplaceAssigneesandReplaceLabelsdid a clear-then-insert loop with no transaction, so a failed insert, or a duplicate id in the input hitting the unique constraint, left the issue with all prior rows deleted and only some new ones written.Create/Updatecall these and ignored the error, so the partial write went unreported.Linked issues
Closes #341
Type of change
fix:)Surface
apps/api/)What changed
Moved the clear-and-insert into
IssueStore.ReplaceAssignees/ReplaceLabels, which run in one transaction and de-dupe the input, so the operation either fully applies or rolls back. This is the same patternModuleStore.SetMembersalready uses. The service methods now call these instead of looping.Test plan
go build,go vet,go test ./...greenAI assistance
Claude Code (Opus 4.8), commits carry aCo-Authored-By:trailer