storage 9.0.0: getFiles apiResponse is now the HTTP response, so the documented apiResponse.prefixes is undefined
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/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ệ
- node.js, typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Start in handwritten/storage, where Bucket#getFiles and the other listing methods pass the HTTP response through as apiResponse; the JSDoc in src/bucket.ts (compiled to build/cjs/src/bucket.js) and MIGRATION.md describe the old shape. Reproduce by listing a bucket with delimiter '/' and checking whether the body sits at apiResponse or apiResponse.data. Done means either the body is restored to apiResponse for these methods, or the JSDoc and MIGRATION.md state that body fields are under apiResponse.data. The maintainers have not chosen between the two, so confirm the direction before writing code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Package: @google-cloud/storage (handwritten/storage)
Environment
- @google-cloud/storage 9.0.0 (gaxios 8.3.3, google-auth-library 11.3.4)
- Node 26.5.1
- Works as documented with 8.0.0, same code
Steps to reproduce
A bucket with at least one object under a "folder" (for example a/b.txt):
import { Storage } from "@google-cloud/storage";
const bucket = new Storage().bucket("<bucket>");
const [files, nextQuery, apiResponse] = await bucket.getFiles({ delimiter: "/", autoPaginate: false, maxResults: 1 });
console.log(Object.keys(apiResponse), apiResponse.prefixes, apiResponse.nextPageToken);
Actual (9.0.0)
apiResponse is the HTTP response object, and the JSON body is one level down:
[ 'size', 'data', 'config' ] undefined undefined
apiResponse.data has kind, nextPageToken and prefixes.
Expected (8.0.0, and what 9.0.0 still documents)
apiResponse is the JSON body:
[ 'kind', 'nextPageToken', 'prefixes' ] [ 'a/' ] '...'
The JSDoc shipped in 9.0.0 still describes the old shape: the Bucket#getFiles example reads apiResponse.prefixes, and the delimiter option says results are "returned in apiResponse.prefixes" (build/cjs/src/bucket.js).
Impact
Code that follows the documented way to list folders gets undefined for prefixes and nextPageToken after upgrading. Nothing throws, and apiResponse is typed unknown, so type checks do not catch it: folder listings silently come back empty and manual paging stops after the first page.
MIGRATION.md covers apiResponse.headers becoming a Headers object, but does not say that the body moved from apiResponse to apiResponse.data. The same change appears to apply to the other methods that now pass the response through (Storage#getBuckets, Storage#getHmacKeys, Bucket#getNotifications, File#copy, ...).
Request
Either pass the body as apiResponse again for these methods, or keep the new shape and update the JSDoc and MIGRATION.md to say that body fields are now under apiResponse.data.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.2k
- Fork
- 732
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 99
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 googleapis/google-cloud-node
-
Broken deprecation chainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
googleapis/google-cloud-node#9854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedĐang mởapi: pubsub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9853 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeadersCó thể đã có người làm @itsrayeedscodespace đã nhận 9 ngày trước. Đang mởapi: storage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9840 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
firestore: getPartitions() emits gax AutopaginateTrueWarning in every processCó thể đã có người làm @TheRealDanii đã nhận 13 ngày trước. Đang mởapi: firestore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
googleapis/google-cloud-node#9736 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-node#9723 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/google-cloud-node
Issue tương tự
-
area: batch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
inabagumi/shinju-date#7294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
streaming-video-technology-alliance/common-media-library#700 ·
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 82/100
vercel-labs/ui#809 ·
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 67/100
KrisCris/village-in-the-shade-guide#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:platform-js status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
midnightntwrk/platform-js#38 ·