Description
When assigning a user to a submission role (reviewer, coordinator, submitter) via the updateSubmission mutation, if the user is already assigned, the app relies on the MySQL unique constraint (submission_user_unique) to reject the duplicate. This produces an unhandled SQL exception in the Laravel log rather than a clean validation error returned to the client.
Steps to reproduce
- Assign a user as a reviewer on a submission
- Try to assign the same user again as a reviewer
- A
SQLSTATE[23000]: Integrity constraint violation error is logged
Expected behavior
The API should validate that the user isn't already assigned to the requested role before attempting the insert, and return a clear GraphQL error to the client.
Impact
The SQL error generates noise in production/development logs. During E2E testing, it makes it harder to distinguish real errors from expected validation failures.
Found during
Playwright E2E test development — the submission_user_unique constraint violation appears in Laravel logs when tests attempt duplicate assignments.
Description
When assigning a user to a submission role (reviewer, coordinator, submitter) via the
updateSubmissionmutation, if the user is already assigned, the app relies on the MySQL unique constraint (submission_user_unique) to reject the duplicate. This produces an unhandled SQL exception in the Laravel log rather than a clean validation error returned to the client.Steps to reproduce
SQLSTATE[23000]: Integrity constraint violationerror is loggedExpected behavior
The API should validate that the user isn't already assigned to the requested role before attempting the insert, and return a clear GraphQL error to the client.
Impact
The SQL error generates noise in production/development logs. During E2E testing, it makes it harder to distinguish real errors from expected validation failures.
Found during
Playwright E2E test development — the
submission_user_uniqueconstraint violation appears in Laravel logs when tests attempt duplicate assignments.