Skip to content

Revert "Revert "fix: Check (transitions) creation race condition""#459

Open
Josyann wants to merge 1 commit intomainfrom
revert-457-revert-455-fix/check_creation_race_condition
Open

Revert "Revert "fix: Check (transitions) creation race condition""#459
Josyann wants to merge 1 commit intomainfrom
revert-457-revert-455-fix/check_creation_race_condition

Conversation

@Josyann
Copy link
Collaborator

@Josyann Josyann commented Mar 2, 2026

Reverts #457

Original PR was not the issue. Reverting the revert 🙄

@Josyann Josyann self-assigned this Mar 2, 2026

def create_checks
all_checks.select(&:new_record?).each(&:save)
Check.types.each_value { |klass| checks.create_or_find_by!(type: klass.name) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

ils peuvent déjà exister ? je me dis qu'on devrait mieux utiliser create tout court pour éviter le cas étrange où un check existe déjà quand on fait create_checks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tu as parfaitement raison, merci !

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.

[BUG] Erreur Statesman::TransitionConflictError à la création d'un site

2 participants