name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: "
labels: bug
assignees: ''
⚡️ Describe the Bug
The textToJSON.init method in src/backend.py (line 11) uses a mutable default argument json={}. In Python, default arguments are evaluated once at function definition time, not at each call. This means every instance of textToJSON that doesn't explicitly pass json shares the same dictionary object. Data extracted from one incident report silently leaks into the next.
👣 Steps to Reproduce
- Open a python shell or create a test script
- Run the following
from backend import textToJSON
This requires Ollama running, but the bug can be proven with a minimal example:
class Demo:
def init(self, data={}):
self.data = data
a = Demo()
a.data["officer_name"] = "John Doe"
b = Demo()
print(b.data)
print(a.data is b.data) # True ← same object in memory
- In FireForm's context: process two different incident reports sequentially without restarting the container — the second report will contain fields from the first .
📉 Expected Behavior
Each textToJSON instance should have its own isolated dictionary. Processing Report 2 should never contain data from Report 1.
🖥️ Environment Information
- OS: Windows 11 / Any (bug is language-level, not OS-specific)
- Docker/Compose Version: Any - Ollama Model used: N/A (bug is in Python code, not LLM-dependent)
📸 Screenshots/Logs
🕵️ Possible Fix
def init(self, transcript_text, target_fields, json=None):
if json is None:
json = {}
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: "
labels: bug
assignees: ''
⚡️ Describe the Bug
The textToJSON.init method in src/backend.py (line 11) uses a mutable default argument json={}. In Python, default arguments are evaluated once at function definition time, not at each call. This means every instance of textToJSON that doesn't explicitly pass json shares the same dictionary object. Data extracted from one incident report silently leaks into the next.
👣 Steps to Reproduce
from backend import textToJSON
This requires Ollama running, but the bug can be proven with a minimal example:
class Demo:
def init(self, data={}):
self.data = data
a = Demo()
a.data["officer_name"] = "John Doe"
b = Demo()
print(b.data)
print(a.data is b.data) # True ← same object in memory
📉 Expected Behavior
Each textToJSON instance should have its own isolated dictionary. Processing Report 2 should never contain data from Report 1.
🖥️ Environment Information
📸 Screenshots/Logs
🕵️ Possible Fix
def init(self, transcript_text, target_fields, json=None):
if json is None:
json = {}