This file summarizes the code change made to address the duplicate-detection issue reported in the backend.
- Updated the
POST /tickets/saveendpoint inbackend/main.py. - After a ticket is successfully inserted into Supabase, the backend now calls
duplicate_service.add_ticket(...). - The duplicate index uses the saved ticket text, preferring
descriptionand falling back tosubjectif needed. - If indexing fails, the ticket still saves successfully, but the API now returns a non-breaking warning so the failure is visible.
Previously, tickets created through the normal save flow were stored in Supabase but were not added to the duplicate-detection cache. That meant future similar tickets could be missed unless the original ticket already existed in the in-memory index.
- Newly saved tickets are now available for future duplicate checks immediately after persistence.
- The save flow remains resilient even if duplicate indexing fails.
- Ran a backend error check on the modified file.
- No errors were reported for
backend/main.py.