Skip to content

fix: Catch unique constraint violation when creating new documents - #4289

Merged
juliusknorr merged 1 commit into
mainfrom
fix/2848
Jun 13, 2023
Merged

fix: Catch unique constraint violation when creating new documents#4289
juliusknorr merged 1 commit into
mainfrom
fix/2848

Conversation

@juliusknorr

@juliusknorrjuliusknorr commented Jun 13, 2023

Copy link
Copy Markdown
Member

There might be cases where multiple requests try to create a new document entry where the previous query to get the document returned none but at the time of insert another request already inserted.

This is a care we should handle more gracefully and instead query the db again and return the document entity.

📝 Summary

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@cypress

cypressBot commented Jun 13, 2023

Copy link
Copy Markdown

3 flaky tests on run #10149 ↗︎

014710Flakiness3

Details:

fix: Catch unique constraint violation when creating new documents
Project: TextCommit:48a4934321
Status: PassedDuration: 03:49 💡
Started: Jun 13, 2023 6:01 PMEnded: Jun 13, 2023 6:04 PM
Flakiness sync.spec.js • 1 flaky test

ViewOutputVideo

Test Artifacts
Sync > recovers from a lost connection OutputScreenshots
Flakiness nodes/HardBreak.spec.js • 1 flaky test

ViewOutputVideo

Test Artifacts
Hard break support > Convert paragraph break into hard break OutputScreenshots
Flakiness api/UsersApi.spec.js • 1 flaky test

ViewOutputVideo

Test Artifacts
The user mention API > fetches users with valid session OutputScreenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@juliusknorr
juliusknorr requested a review from blizzzJune 13, 2023 16:59
@juliusknorr
juliusknorr merged commit ea13459 into mainJun 13, 2023
@delete-merged-branch
delete-merged-branchBot deleted the fix/2848 branch June 13, 2023 18:28
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable27

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable25

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewbugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrity constraint violation in document table due to duplicate id

2 participants

@juliusknorr@blizzz