Invalid attachment data on server error when getting doc with attachments
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
- Lĩnh vực
- database
Hướng nghiên cứu
Chạy bản tái hiện gist với thiết lập nginx và CouchDB, sau đó kiểm tra packages/node_modules/pouchdb-core/src/adapter.js tại dòng 665, nơi các lỗi của yêu cầu attachment chưa được xử lý. Issue được hoàn tất khi một yêu cầu attachment thất bại khiến yêu cầu tài liệu ném ra lỗi thay vì lưu phản hồi lỗi của máy chủ dưới dạng dữ liệu attachment.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue
When requesting a doc with attachments, if an attachment request fails, the doc attachment data will save the error message, instead of failing the request, resulting in invalid attachments.
This can happen during replication, bulkGet, etc.
Info
- Environment: node.js, browser
- Adapter: http (?)
- Server: CouchDb
Reproduce
Here's the gist: https://gist.github.com/dianabarsan/c08f5fc114c221a99d2afad7c870bf76
It adds a minimal nginx config that responds with a 400 to an attachment request, and proxies all other requests to a vanilla CouchDb 3.4.2, using docker compose.
Has a Javascript file that:
- creates a database
- creates a doc with a plain text attachment
- initializes a PouchDb connection and does a
db.getand logs the content of the attachment, which is the default nginx html error page for 400.
Desired behavior here would be to throw an error when the attachment get request responds with an error.
Faulty code is here:
https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-core/src/adapter.js#L665 where the potential error is not handled.
- Ngôn ngữ chính
- JavaScript
- Star
- 17.6k
- Fork
- 1.5k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 apache/pouchdb
-
elemMatch throws TypeError: value is null if array has null elementCó thể đã có người làm @henyanagar đã nhận 143 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
unref event is not documentedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Validate database namesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Tất cả issue của apache/pouchdb
Issue tương tự
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
serienstream.toĐang mởN: AdGuard for Windows P2: High T: Annoyance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
AdguardTeam/AdguardFilters#246310 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Website: the hero tip's video play() has no catch, so a refused play is an unhandled rejectionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
liberation-data/drivine#615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug dependencies known-issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
unreleased dependencies
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
cloudfour/eslint-config#760 ·
Maintainer thường phản hồi trong vòng 1 ngày