AOSSIE-Org / AOSSIE-Org/Ell-ena

CRITICAL: Race Condition in generate_ticket_number()

Ouverte
#52 3 commentaires 0 réactions 1 personne assignée Réclamée par @g-k-s-03 Voir sur GitHub
Langage dominant
Dart
Étoiles
54
Forks
110
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

I**ssue Overview**
The generate_ticket_number() trigger on the tickets table can generate duplicate ticket numbers when multiple tickets are inserted concurrently. This is a race condition in the current logic.

**Steps to Reproduce**
Insert multiple tickets at the same time (concurrent inserts).
Observe that two or more tickets may get the same ticket_number.

**Expected Behavior**
Each ticket should receive a unique ticket number, even if multiple inserts happen simultaneously.

**Actual Behavior**
Duplicate ticket numbers are generated.
Inserts may fail due to primary key conflicts.
Numbering is inconsistent under concurrent load.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.