Deleting an instrument record leaves an orphaned session, and no endpoint can delete a session
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 53/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend-api-design, databases
Hướng nghiên cứu
Start with apps/api/src/instrument-records/instrument-records.service.ts and SessionsController to trace record deletion, session references, and the existing session routes. The issue lists three possible approaches but does not choose one; clarify the intended scope and check the relevant tests before making a change. Done means preventing or removing orphaned sessions as agreed, while preserving sessions that still have records.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Deleting an instrument record leaves its session in the database, and no endpoint can delete a session.
InstrumentRecordsService.deleteById(apps/api/src/instrument-records/instrument-records.service.ts) deletes the record and its files only.SessionsControllerhas onlyPOST /sessionsandGET /sessions.- The only path that deletes sessions is
DELETE /subjects/:id?force=true, which deletes the whole subject.
Every session created by the bulk upload or by a form holds exactly one record, so each record delete leaves an empty session. These sessions:
- count toward
GET /summarycounts.sessionsand its trend, - appear in the session list and the subject's session history,
- cannot be removed by an admin without direct database access.
Observed
On a production instance (v2.5.2), a cleanup of about 26,000 duplicate bulk-uploaded records through DELETE /instrument-records/:id would leave about 26,000 empty sessions. Before any cleanup, that instance already has 79 sessions with no record.
Options
- In
deleteById, also delete the record's session in the same transaction when no other record references it. - Add
DELETE /sessions/:id(@RouteAccess({ action: 'delete', subject: 'Session' })), rejected while the session still has records. - Both.
Option 1 stops new orphans. Option 2 (or a one-off migration) is still necessary to remove the sessions that are already orphaned.
- Ngôn ngữ chính
- TypeScript
- Star
- 119
- Fork
- 19
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 61
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DouglasNeuroInformatics/OpenDataCapture
-
Area: API Bug Difficulty: Low Priority: Low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area: Infrastructure Bug Difficulty: Low Priority: Medium Security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DouglasNeuroInformatics/OpenDataCapture#1916 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area: Instruments Bug Difficulty: Low Priority: Low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Completing a series instrument logs a TypeError "Cannot read properties of undefined (reading 'kind')"Có thể đã có người làm @SAY-5 đã nhận 3 ngày trước. Đang mởArea: Shared Bug Difficulty: Low Priority: Low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DouglasNeuroInformatics/OpenDataCapture
Issue tương tự
-
bug done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
neavo/LinguaGacha#1124 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errorsCó thể đã có người làm @fullsend-ai-coder đã nhận hôm nay. Đang mởe2e-failure ready-to-code
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
brylie/mission-island#225 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement from-app needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nightly-labs/openbot#14986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status/need-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google-gemini/gemini-cli#30412 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày