Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jun 13, 2023

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
Copy link

cypress bot commented Jun 13, 2023

3 flaky tests on run #10149 ↗︎

0 147 1 0 Flakiness 3

Details:

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

View Output Video

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

View Output Video

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

View Output Video

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

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

@juliusknorr juliusknorr requested a review from blizzz June 13, 2023 16:59
@juliusknorr juliusknorr merged commit ea13459 into main Jun 13, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/2848 branch June 13, 2023 18:28
@juliusknorr
Copy link
Member Author

/backport to stable27

@juliusknorr
Copy link
Member Author

/backport to stable26

@juliusknorr
Copy link
Member Author

/backport to stable25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something 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