Task #19365
closedCharge Template - Duplicate Charge Appears in Charge Template After Save (Intermittent Issue)
Description
In the Charge Template module, when saving a charge (e.g., Document Fee), the same charge sometimes appears twice in the charge list after saving.
This issue is intermittent and difficult to consistently reproduce. It was first observed at Logideals and has since occurred again at United Cargo.
The duplication occurs without the user intentionally adding the charge twice, indicating a potential issue with save logic, UI refresh, or duplicate submission handling.
Steps Observed (Intermittent)
- Navigate to Charge Template
- Click to Add New Charge Template
- Add a charge (e.g., Doc Fee)
- Click Save
- Observe that the same charge appears twice in the charge list (occasionally)
Expected Result
- The charge is saved once and appears only once in the charge list.
Actual Result
- The same charge appears twice after saving.
Acceptance Criteria
No Duplicate Charges
- On saving a charge in Charge Template:
- The charge appears only once in the list.
- Duplicate entries are not created, even on repeated or rapid save actions.
Idempotent Save
- Multiple save triggers (double-click, latency, refresh) do not create duplicate charge records.
Data Integrity
- Backend enforces uniqueness to prevent duplicate charge creation for the same template.
Stability
- Fix addresses intermittent behaviour and remains stable across repeated testing.
GitLab Sync Log
[{"id": "38137", "author": "Avisham", "hours": 1.0, "created": "2026-02-04T09:57:16.250Z", "log_date": "2026-02-03", "comment": "Imported from GitLab by @Avisham on 2026-02-04T09:57:16.250Z: 1h-(1.0)h spend at: 2026-02-03", "status": "active", "deleted_by": "", "redmine_entry_id": 12153}, {"id": "39778", "author": "Yashvee Seetul", "hours": 1.0, "created": "2026-03-05T06:16:32.376Z", "log_date": "2026-03-04", "comment": "Imported from GitLab by @Yashvee Seetul on 2026-03-05T06:16:32.376Z: 1h-(1.0)h spend at: 2026-03-04", "status": "active", "deleted_by": "", "redmine_entry_id": 12517}]
Updated by Redmine Admin 7 months ago
- Status changed from New to Development Done
- GitLab Time Logged changed from 0 to 3600
Updated by Redmine Admin 7 months ago
- Status changed from Development Done to QA
Updated by Redmine Admin 6 months ago
- Status changed from QA to Closed
- % Done changed from 0 to 100
- GitLab Time Logged changed from 3600 to 7200