`bos db doctor` checks expected tables only in `public` — misreports plugin_schema (v2) and v1 topologies
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
- 52/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ệ
- typescript
- Lĩnh vực
- database
Hướng nghiên cứu
Read services/db/doctor.ts and compare its missing-tables query with the schemaName handling in runMigrations and detectDrift. Trace how workspace topology determines the data schema for plugins versus api/auth or dedicated databases. Done means the doctor checks expected tables in the schema used by each topology and reports healthy and drift states consistently.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
everything-dev 2.0.0-rc.27
Where
services/db/doctor.ts — the missing-tables query hard-codes the schema:
```ts
// dist/services/db/doctor.mjs:60
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name = ANY($1)
```
Context
v2 scopes plugin data tables into a `plugin_` schema on the shared database: the driver sets `search_path="plugin_,public"` per pooled connection, and `runMigrations` / `detectDrift` take a `schemaName` parameter they use for the same table-existence query. The migration journal is the shared `drizzle.__drizzle_migrations`. The doctor never learned about the namespace.
Failure modes (both observed on nearbuilders.org during a v1→v2 consolidation)
- v1 per-plugin database (tables in `public`, journal present): doctor reports `healthy` while boot fails with `drift-safe-repair` — because the runtime checks `plugin_`, not `public`.
- Consolidated shared database (tables in `plugin_`): doctor reports `drift-safe-repair` for completely healthy databases. Combined with `bos db repair` (see my related issue on repair) this invites destroying a working state.
Suggested fix
Resolve the workspace's data schema per topology — `plugin_` for plugins, `public` for api/auth/dedicated-DB — and query the expected tables there, mirroring `detectDrift`'s `schemaName` handling.
- Ngôn ngữ chính
- TypeScript
- Star
- 5
- Fork
- 3
- Merge trung bình
- 9 giờ 37 phút
- Pull request đã merge (30 ngày)
- 157
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 NEARBuilders/everything-dev
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NEARBuilders/everything-dev#628 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NEARBuilders/everything-dev#400 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NEARBuilders/everything-dev#667 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
NEARBuilders/everything-dev#666 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
NEARBuilders/everything-dev#665 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NEARBuilders/everything-dev
Issue tương tự
-
bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
PhyberApex/kuroshiro#1687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/monaco-editor#5563 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
awslabs/visual-asset-management-system#937 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100