acmpesuecc / acmpesuecc/KissanDial
Fix Global Variable Thread-Safety Issue
- Linguagem predominante
- Python
- Estrelas
- 0
- Forks
- 10
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
## **Description**
The application uses a global variable `to_say` that's modified across multiple endpoints. When multiple farmers call simultaneously, their responses get mixed up because all calls share the same global variable. This is a critical production bug.
## **Example of the Problem:**
```
Farmer A calls: "Tell me about PM-KISAN"
Farmer B calls: "Weather forecast please"
Agent sets to_say = "PM-KISAN gives Rs. 6000..."
Agent sets to_say = "Today's weather is sunny..." (overwrites!)
Farmer A hears: "Today's weather is sunny..." ❌ (Wrong response!)
```
## **What needs to be done:**
- Remove the global `to_say` variable
- Implement session-based conversation storage using Flask sessions
- Store conversation state per Call SID (unique for each call)
- Update both `/voice` and `/handle-speech` endpoints
- Test with concurrent calls (simulate using multiple requests)
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.