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

CV2-5391: use save instead of save! to avoid raising error #2061

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

melsawy
Copy link
Contributor

@melsawy melsawy commented Oct 1, 2024

Description

Based on CV2-5324 there is a method to check Relationship exists before creating a new one but may the failure related to other validation so I use a save instead of save! to avoid raising error

References: CV2-5391

How has this been tested?

Re-run automated tests.

Things to pay attention to during code review

Please describe parts of the change that require extra attention during code review, for example:

  • File FFFF, line LL: This refactoring does this and this. Is it consistent with how it’s implemented elsewhere?
  • Etc.

Checklist

  • I have performed a self-review of my own code
  • I have added unit and feature tests, if the PR implements a new feature or otherwise would benefit from additional testing
  • I have added regression tests, if the PR fixes a bug
  • I have added logging, exception reporting, and custom tracing with any additional information required for debugging
  • I considered secure coding practices when writing this code. Any security concerns are noted above.
  • I have commented my code in hard-to-understand areas, if any
  • I have made needed changes to the README
  • My changes generate no new warnings
  • If I added a third party module, I included a rationale for doing so and followed our current guidelines

Copy link
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, Sawy... This is good for race conditions.

@melsawy melsawy merged commit 6cae6c3 into develop Oct 1, 2024
7 checks passed
@melsawy melsawy deleted the fix/CV2-5391-sidekiq-dead-jobs branch October 1, 2024 14:36
Copy link

sentry-io bot commented Oct 3, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "relationships_least_... Sidekiq/SmoochWorker View Issue
  • ‼️ ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "relationships_least_... Sidekiq/Sidekiq::Extensions::DelayedClass View Issue

Did you find this useful? React with a 👍 or 👎

DGaffney pushed a commit that referenced this pull request Oct 15, 2024
* CV2-5391: use save instead of save! to avoid raising error

* CV2-5391: fix archived validation error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants