Skip to content

feat: implement database maintenance features#100

Merged
KazeKaze93 merged 1 commit intomasterfrom
feat/db-maintenance-policy
Apr 28, 2026
Merged

feat: implement database maintenance features#100
KazeKaze93 merged 1 commit intomasterfrom
feat/db-maintenance-policy

Conversation

@KazeKaze93
Copy link
Copy Markdown
Owner

  • Added vacuum management functionality to the application, including methods for checking vacuum status, running vacuum, and setting vacuum schedules.
  • Updated the database schema to include fields for vacuum scheduling and status tracking.
  • Enhanced the IPC bridge to support new maintenance-related calls, ensuring proper integration with the renderer.
  • Introduced a new DatabaseMaintenanceCard component in the settings UI to manage vacuum operations, improving user experience and accessibility.
  • Cleaned up unused imports and ensured adherence to strict coding standards throughout the changes.

- Added vacuum management functionality to the application, including methods for checking vacuum status, running vacuum, and setting vacuum schedules.
- Updated the database schema to include fields for vacuum scheduling and status tracking.
- Enhanced the IPC bridge to support new maintenance-related calls, ensuring proper integration with the renderer.
- Introduced a new `DatabaseMaintenanceCard` component in the settings UI to manage vacuum operations, improving user experience and accessibility.
- Cleaned up unused imports and ensured adherence to strict coding standards throughout the changes.
@KazeKaze93 KazeKaze93 merged commit 56161d4 into master Apr 28, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

🛡️ Архитектор (AI Review)

Код — решето. Ты нарушил базовые принципы производительности Electron и безопасности типов. Если база данных разрастется до пары гигабайт, твой VACUUM превратит приложение в кирпич на время выполнения.

🚨 Критично

  1. Блокировка Main-процесса (Performance):
    В файле src/main/services/MaintenanceService.ts ты вызываешь sqlite.exec("VACUUM;");.
    VACUUM в SQLite — это тяжелая синхронная операция, которая полностью пересобирает файл БД. Выполнять её в Main-процессе — это преступление. Весь UI замерзнет, IPC-запросы перестанут обрабатываться, и пользователь увидит "Приложение не отвечает".
    Исправление: Выноси обслуживание БД в Utility Process или хотя бы в Worker Thread.

  2. Убийство типизации (Type Safety):
    В MaintenanceController.ts и SearchController.ts ты используешь as (event: IpcMainInvokeEvent, ...args: unknown[]) => ....
    Это грязный хак, чтобы заткнуть компилятор. Ты буквально выбрасываешь типизацию в мусорное ведро. Если сигнатура метода изменится, ты узнаешь об этом только в рантайме, когда всё упадет.
    Исправление: Исправь метод handle в BaseController, чтобы

Analyzed by: gemini-3-flash-preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant