From 6e3f072fdc66bdfc459b9ca5c8241a203f80251a Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 31 Mar 2026 23:05:34 -0700 Subject: [PATCH] chore: add backlog tasks for axios migration, remote backend, and PR-38 - TASK-264: replace axios with native fetch across the project - TASK-265: add remote Postgres backend for immersion tracking and stats - TASK-268: address CodeRabbit review action items for PR #38 (done) --- ...os-with-native-fetch-across-the-project.md | 26 +++++++++ ...sion-tracking-and-stats-prefer-Postgres.md | 53 +++++++++++++++++++ ...odeRabbit-review-action-items-for-PR-38.md | 34 ++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 backlog/tasks/task-264 - Replace-axios-with-native-fetch-across-the-project.md create mode 100644 backlog/tasks/task-265 - Add-remote-backend-for-immersion-tracking-and-stats-prefer-Postgres.md create mode 100644 backlog/tasks/task-268 - Address-CodeRabbit-review-action-items-for-PR-38.md diff --git a/backlog/tasks/task-264 - Replace-axios-with-native-fetch-across-the-project.md b/backlog/tasks/task-264 - Replace-axios-with-native-fetch-across-the-project.md new file mode 100644 index 00000000..1ca38e59 --- /dev/null +++ b/backlog/tasks/task-264 - Replace-axios-with-native-fetch-across-the-project.md @@ -0,0 +1,26 @@ +--- +id: TASK-264 +title: Replace axios with native fetch across the project +status: To Do +assignee: [] +created_date: '2026-04-01 00:44' +labels: [] +dependencies: [] +priority: medium +--- + +## Description + + +Remove axios from the codebase and migrate all project HTTP requests to the platform fetch API, preserving existing request behavior and error handling where applicable. + + +## Acceptance Criteria + +- [ ] #1 No production code paths import or depend on axios. +- [ ] #2 All existing HTTP requests use fetch or a project-local abstraction built on fetch. +- [ ] #3 Request behavior remains functionally equivalent for headers, query params, bodies, status handling, and abort/error cases that are currently supported. +- [ ] #4 Tests are updated or added to cover the migrated request flows. +- [ ] #5 Documentation is updated if any request semantics or setup steps change. +- [ ] #6 axios is removed from project dependencies if it is no longer needed. + diff --git a/backlog/tasks/task-265 - Add-remote-backend-for-immersion-tracking-and-stats-prefer-Postgres.md b/backlog/tasks/task-265 - Add-remote-backend-for-immersion-tracking-and-stats-prefer-Postgres.md new file mode 100644 index 00000000..c4410a6f --- /dev/null +++ b/backlog/tasks/task-265 - Add-remote-backend-for-immersion-tracking-and-stats-prefer-Postgres.md @@ -0,0 +1,53 @@ +--- +id: TASK-265 +title: Add remote backend for immersion tracking and stats (prefer Postgres) +status: To Do +assignee: [] +created_date: '2026-04-01 00:47' +labels: [] +dependencies: [] +references: + - >- + /home/sudacode/projects/japanese/SubMiner/src/core/services/immersion-tracker-service.ts + - >- + /home/sudacode/projects/japanese/SubMiner/src/core/services/immersion-tracker/storage.ts + - >- + /home/sudacode/projects/japanese/SubMiner/src/core/services/immersion-tracker/sqlite.ts + - /home/sudacode/projects/japanese/SubMiner/src/stats-daemon-runner.ts + - /home/sudacode/projects/japanese/SubMiner/src/core/services/stats-server.ts + - /home/sudacode/projects/japanese/SubMiner/src/main/boot/services.ts + - /home/sudacode/projects/japanese/SubMiner/package.json +documentation: + - /home/sudacode/projects/japanese/SubMiner/docs/architecture/README.md + - >- + /home/sudacode/projects/japanese/SubMiner/docs/architecture/stats-trends-data-flow.md + - /home/sudacode/projects/japanese/SubMiner/README.md + - /home/sudacode/projects/japanese/SubMiner/config.example.jsonc +priority: high +--- + +## Description + + +Enable immersion tracking/stats to use a remote authoritative backend so multiple devices can share the same history. + +Current state: `ImmersionTrackerService` opens a local `immersion.sqlite` file from the app data/config path, `stats-daemon-runner` points at that same local file, and `config.example.jsonc` only exposes `immersionTracking.dbPath` for a local path override. The stats API/dashboard reads from the same tracker service and assumes the local database is the source of truth. + +Goal: add a remote backend option that avoids shared filesystem/database-file syncing between devices. Do not use SSH/rsync/shared network filesystem as the primary sync strategy for live multi-device use. + +Backend choice: prefer Postgres if it can be integrated without a broad new dependency surface or destabilizing the current runtime; otherwise use the least invasive remote backend that can be shipped with the current stack and document the tradeoff clearly. Preserve the current local SQLite mode as the default/offline fallback if possible. + +This ticket should cover the full product/architecture change: configuration, storage access, stats reads, startup/error handling, migration/bootstrap from existing local data, tests, and docs. + + +## Acceptance Criteria + +- [ ] #1 The app can be configured to use a remote authoritative backend for immersion tracking instead of only a local `immersion.sqlite` file. +- [ ] #2 The chosen backend persists tracker writes and serves the existing stats read models across app restarts. +- [ ] #3 Two devices can point at the same remote backend without relying on a shared filesystem or raw SQLite file sync. +- [ ] #4 Local SQLite remains supported as the default or fallback mode for offline use. +- [ ] #5 If the remote backend is unavailable or misconfigured, startup/write paths fail with actionable errors instead of silent data loss. +- [ ] #6 A migration or bootstrap path exists to move existing local immersion data into the remote backend or seed a new device from it. +- [ ] #7 Config/examples/docs explain the backend choice, required connection/setup details, and any security/network assumptions. +- [ ] #8 Tests cover backend selection plus at least one representative write/read path against the remote backend. + diff --git a/backlog/tasks/task-268 - Address-CodeRabbit-review-action-items-for-PR-38.md b/backlog/tasks/task-268 - Address-CodeRabbit-review-action-items-for-PR-38.md new file mode 100644 index 00000000..155230d9 --- /dev/null +++ b/backlog/tasks/task-268 - Address-CodeRabbit-review-action-items-for-PR-38.md @@ -0,0 +1,34 @@ +--- +id: TASK-268 +title: 'Address CodeRabbit review action items for PR #38' +status: Done +assignee: [] +created_date: '2026-04-01 05:35' +updated_date: '2026-04-01 05:40' +labels: + - pr-review + - coderabbit +dependencies: [] +references: + - 'https://github.com/ksyasuda/SubMiner/pull/38' +priority: medium +--- + +## Description + + +Review unresolved CodeRabbit feedback on PR #38 and implement the actionable fixes without regressing duplicate grouping or popup behavior. + + +## Acceptance Criteria + +- [x] #1 All unresolved actionable CodeRabbit review comments on PR #38 are triaged and either fixed in code or explicitly identified as non-actionable or ambiguous. +- [x] #2 Code changes preserve duplicate grouping and popup flow behavior covered by existing or added regression tests. +- [x] #3 Relevant local verification for the affected areas passes. + + +## Final Summary + + +Addressed all unresolved actionable CodeRabbit comments on PR #38. Fixed duplicate tracking so empty duplicate lists are not persisted after sentence-card creation, sanitized Yomitan add-note noteId values to accept only positive integers, preserved paused playback for configured subtitle-seek keybindings when pause state is unknown, and short-circuited duplicate exact-match scanning for single-result lookups. Added regression tests for each case and verified with `bun test` on the affected suites plus `bun run typecheck`, `bun run test:fast`, `bun run test:env`, `bun run build`, and `bun run test:smoke:dist`. +