GET (query) requests don't wrap input in {json: ...}, breaking every parameterized read against tRPC servers using the superjson transformer
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 86/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu trong dist/client.js bằng cách so sánh apiGet với cách xây dựng request apiPost hiện có, sau đó chạy ứng dụng dokploy được báo cáo bằng một lệnh với một truy vấn có tham số. Hoàn tất khi các request GET có tham số thành công với các máy chủ tRPC sử dụng superjson, trong khi các truy vấn không có đối số vẫn tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug
apiPost in dist/client.js correctly wraps mutation payloads as { json: data } before sending, matching tRPC's superjson transformer convention:
export async function apiPost(endpoint, data) {
const client = createClient();
const response = await client.post(`/trpc/${endpoint}`, data ? { json: data } : undefined);
...
}
apiGet does not — it sends the raw params object as the query string, unwrapped:
export async function apiGet(endpoint, params) {
const client = createClient();
const query = params
? `?input=${encodeURIComponent(JSON.stringify(params))}`
: "";
...
}
Against a Dokploy server using the superjson transformer, any query procedure that requires input parameters fails with a 400:
{
"error": {
"json": {
"message": "[\n {\n \"expected\": \"object\",\n \"code\": \"invalid_type\",\n \"path\": [],\n \"message\": \"Invalid input: expected object, received undefined\"\n }\n]",
"code": -32600,
"data": { "code": "BAD_REQUEST", "httpStatus": 400, "path": "application.one", ... }
}
}
}
Repro
dokploy application one --applicationId <id>
# Request failed with status code 400
No-argument queries (e.g. project all) work fine, since an empty/undefined input happens to satisfy those procedures' schemas either way — which is why this doesn't show up immediately.
Expected
apiGet should wrap params the same way apiPost wraps data:
const query = params
? `?input=${encodeURIComponent(JSON.stringify({ json: params }))}`
: "";
Environment
@dokploy/cli0.29.4 (reportsdokploy --version→ 0.3.0)- Dokploy server v0.29.11
- Affects any query command that takes parameters:
application one,deployment all,mounts list-by-service-id, log reads, etc.
- Ngôn ngữ chính
- TypeScript
- Star
- 152
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 Dokploy/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·