Files
tfm_ainventory/backend/services
Daniel Bedeleanu 01321bf607 fix(phase1): restore API contract while preserving N+1 optimization
The N+1 optimization in save_image() pre-lowercases the existing_files list
before passing to get_unique_filename(). However, this broke the API contract:
the function should handle any-case input to remain robust.

Changed: get_unique_filename() now defensively lowercases the input list,
ensuring collision detection works regardless of input case.

Benefits:
- Fixes implicit API contract change (function expected any-case input)
- Maintains N+1 optimization (pre-lowercasing still works)
- Supports both optimization and edge cases (direct function calls)
- All 22 tests pass
2026-04-20 22:09:58 +03:00
..