Skip to content

ActiveRecord::RecordNotUnique when uploading designs

Designs not unique when creating design version.

See: https://sentry.gitlab.net/gitlab/gitlabcom/issues/1566104

This appears to be due to the fact that duplicate design-ids are passed in.


Testing Activity

@.luke

  • Unit test of SaveDesignsService

MR Breakdown

@alexkalderimis

  • Either we are getting duplicate filenames in the input list (which we should be validating and raising argument errors about) or for some other reason we are passing duplicate IDs to the version creation method. I would guard both places, in the mutation and in the service, the first with an argument error and the second with a uniq set

@.luke

@lulalala

  • Investigate if this was caused by race condition, and see if the recent addition of with_lock solves the issue.
Edited by Luke Duncalfe