5sControl / 5sControl/5s-webserver

fix bug algorithms can't be assigned after deleting camera

Open
#122 0 comments 0 reactions 1 assignee Claimed by @ZhuchkouAA View on GitHub
bug
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Алгоритм не может быть назначен после удаления камеры с назначенными алгоритмами

**Precondition:**
Открыто приложение
пользователь авторизован
открыта страница "Configuration"
Авторизована камера, на нее назначены алгоритмы

**Environment:**
Win 11
Chrome 114

**STR:**
1. Кликнуть по кнопке "Удалить" возле камеры с назначенными алгоритмами
2. Кликнуть по кнопке "Remove" в окне "Remove a camera"
3. Кликнуть по кнопке "Add camera"
4. Добавить удаленную камеру
5. Ввести имя и пароль в поля "Username", "Password" (admin. just4Taqtile) вкладка "Camera", window "Camera Settings"
6. Кликнуть по кнопке "Done"
7. Кликнуть по камере
8. Кликнуть по вкладке "Algorithms" window "Camera Settings"
9. Кликнуть по чек-боксу любого алгоритма
10. Кликнуть по кнопке "Done"

**ER:**
Алгоритм назначен на камеру

**AR:**
Алгоритм не назначен на камеру, 500 ошибка запроса POST http://192.168.1.110/api/camera-algorithms/create-process/
**Attachments:**

![Image](https://user-images.githubusercontent.com/122295113/261043758-109b5407-1f78-448d-9e03-0db849c9a431.png)

Contributor guide

Open the contributing guide

Research direction

The bug occurs when re-adding a camera after deletion and trying to assign algorithms, resulting in a 500 error on POST /api/camera-algorithms/create-process/. Start by examining the backend API endpoint for camera-algorithms creation, likely in a controller or route file. Check the database models for Camera and Algorithm to see how associations are managed and if any orphaned records or state issues persist after camera deletion. Reproduce the error locally by following the steps, then inspect server logs for the exact cause of the 500 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.