Inactive Sessions Purging designed
This commit is contained in:
66
specs/009-inactive-sessions-purging/tasks.md
Normal file
66
specs/009-inactive-sessions-purging/tasks.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# Tasks for Inactive Sessions Purging, Form Data Persistence, and Centralized Snackbars
|
||||
|
||||
**Branch**: `009-inactive-sessions-purging` | **Date**: четверг, 16 октября 2025 г.
|
||||
|
||||
## Phase 1: Setup
|
||||
|
||||
- [ ] T001 Ensure `SESSION_TIMEOUT_MINUTES` environment variable is configurable in backend/Dockerfile and backend/.env
|
||||
|
||||
## Phase 2: Foundational
|
||||
|
||||
- [ ] T002 Implement core session management logic for tracking `lastActivityTime` in backend/src/services/SessionService.ts
|
||||
- [ ] T003 Implement ephemeral server-side session storage in backend/src/services/SessionService.ts
|
||||
- [ ] T004 Set up WebSocket server in backend/src/ws/index.ts
|
||||
- [ ] T005 Set up WebSocket client in frontend/src/services/websocket.ts
|
||||
|
||||
## Phase 3: User Story 1 - System purges inactive sessions (Priority: P1)
|
||||
|
||||
- [ ] T006 [US1] Implement session inactivity check based on `lastActivityTime` and `SESSION_TIMEOUT_MINUTES` in backend/src/services/SessionService.ts
|
||||
- [ ] T007 [US1] Implement session purging mechanism in backend/src/services/SessionService.ts
|
||||
- [ ] T008 [US1] Add unit/integration tests for session purging in backend/tests/sessions.test.ts
|
||||
|
||||
## Phase 4: User Story 2 - User input values are persisted across navigation (Priority: P1)
|
||||
|
||||
- [ ] T009 [P] [US2] Implement WebSocket handler for `FORM_UPDATE` to save form data to session in backend/src/ws/index.ts
|
||||
- [ ] T010 [P] [US2] Implement WebSocket handler for `FORM_STATE_SYNC` to send form data to client in backend/src/ws/index.ts
|
||||
- [ ] T011 [P] [US2] Implement HTTP GET endpoint for `/api/session/form-data/{formId}` in backend/src/api/sessions.ts
|
||||
- [ ] T012 [P] [US2] Implement HTTP DELETE endpoint for `/api/session/form-data/{formId}` in backend/src/api/sessions.ts
|
||||
- [ ] T013 [P] [US2] Implement form component to send `FORM_UPDATE` via WebSocket on input change in frontend/src/components/DesireForm.tsx
|
||||
- [ ] T014 [P] [US2] Implement form component to receive `FORM_STATE_SYNC` and pre-fill form fields in frontend/src/components/DesireForm.tsx
|
||||
- [ ] T015 [P] [US2] Implement logic to clear persisted form data on successful form submission in frontend/src/components/DesireForm.tsx
|
||||
- [ ] T016 [P] [US2] Implement subtle, non-intrusive visual indicator for WebSocket failure in frontend/src/components/ErrorState.tsx or similar
|
||||
- [ ] T017 [US2] Add unit/integration tests for form data persistence in frontend/tests/DesireForm.test.tsx and backend/tests/sessions.test.ts
|
||||
|
||||
## Phase 5: User Story 3 - Snackbars are consistently displayed (Priority: P2)
|
||||
|
||||
- [ ] T018 [P] [US3] Implement a centralized snackbar component in frontend/src/components/SnackbarDisplay.tsx (new file)
|
||||
- [ ] T019 [P] [US3] Ensure snackbars appear in the top right corner, aligned with page heading in frontend/src/components/SnackbarDisplay.tsx
|
||||
- [ ] T020 [P] [US3] Implement stacking/queueing behavior for multiple snackbars in frontend/src/components/SnackbarDisplay.tsx
|
||||
- [ ] T021 [US3] Add unit/integration tests for snackbar display in frontend/tests/SnackbarDisplay.test.tsx (new file)
|
||||
|
||||
## Phase 6: Polish & Cross-Cutting Concerns
|
||||
|
||||
- [ ] T022 Review and refine error handling for all features across backend and frontend
|
||||
- [ ] T023 Update documentation (e.g., README, API docs) in README.md and specs/009-inactive-sessions-purging/plan.md
|
||||
- [ ] T024 Performance testing and optimization for session purging and form persistence
|
||||
|
||||
## Dependencies
|
||||
|
||||
- Phase 1 (Setup) -> Phase 2 (Foundational)
|
||||
- Phase 2 (Foundational) -> Phase 3 (US1)
|
||||
- Phase 2 (Foundational) -> Phase 4 (US2)
|
||||
- Phase 2 (Foundational) -> Phase 5 (US3)
|
||||
- Phase 3, 4, 5 -> Phase 6 (Polish)
|
||||
|
||||
## Parallel Execution Examples
|
||||
|
||||
- **User Story 2 (Form Persistence)**: Tasks T009-T016 can be worked on in parallel by different developers, as they cover distinct backend and frontend components. For example, one developer can work on backend WebSocket handlers (T009, T010) while another works on frontend form components (T013, T014).
|
||||
- **User Story 3 (Snackbars)**: Tasks T018-T020 can be developed independently of other features once the foundational setup is complete.
|
||||
|
||||
## Implementation Strategy
|
||||
|
||||
This feature will be implemented using an MVP-first approach, delivering value incrementally:
|
||||
|
||||
1. **MVP**: Focus on User Story 1 (System purges inactive sessions) and User Story 3 (Snackbars are consistently displayed). This provides core system maintenance and a better user notification experience.
|
||||
2. **Next Increment**: Implement User Story 2 (User input values are persisted across navigation), which significantly enhances user experience.
|
||||
3. **Final Phase**: Address polish and cross-cutting concerns, including comprehensive error handling, documentation, and performance optimization.
|
||||
Reference in New Issue
Block a user