ZIP imports fail on uncommon filetypes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo luồng import ZIP và cách manifest.json cùng thư viện mimetypes của Python xác định ContentType. So sánh với luồng upload trên trình duyệt đối với các loại không phổ biến như .webp và .avif. Hoàn thành khi các lần import ZIP xử lý các tệp được chấp nhận mà không gặp lỗi validation đã được báo cáo, đồng thời có coverage cho các loại tệp bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In Zendesk 9788, a user reported this error being displayed when they tried to import a ZIP created using the export function originally discussed in #304
Parameter validation failed: Invalid type for parameter ContentType, value: None, type: , valid types:
It turns out that the python mimetypes library on our production system fails to guess the type of .webp and .avif files, among others. There's an asymmetry in that, when uploaded, the browser reports the mime type, so users of the editor can introduce these files without a hitch, but the import process doesn't know what the mimetype was.
The workaround, in this case, was to remove the problem files from the ZIP, import the rest of the archive, and then use the editor to re-upload the single .webp file which was actually being used (the rest were not used in the storymap)
A partial solution would be to configure mimetypes to understand more filetypes. .webp seems pretty natural. I was unfamiliar with .avif but CanIUse reports that most browsers except Edge support it. Still, this kind of kicks the can down the road without necessarily solving it.
Another option, which may not actually be possible, would be to write the mime types into the manifest.json included in the export ZIP, if we can recover them, perhaps from boto. Using this instead of "guessing" should ensure that any file we've accepted through the editor can also be accepted through the import.
See also #487 which suggests limiting which files are included in exports. In this case it would have filtered out most, but not all, of the uncommon filetypes.
- Ngôn ngữ chính
- JavaScript
- Star
- 249
- Fork
- 61
- 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
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không 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 NUKnightLab/StoryMapJS
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NUKnightLab/StoryMapJS#507 ·
-
Visual glitchesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
NUKnightLab/StoryMapJS#506 ·
-
Provide a npm distributionĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NUKnightLab/StoryMapJS#505 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
NUKnightLab/StoryMapJS#495 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NUKnightLab/StoryMapJS#487 ·
Tất cả issue của NUKnightLab/StoryMapJS
Issue tương tự
-
Design only Leadership Survey SLFS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
bcgov/digital-journeys#2293 ·
-
Toolkit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
API Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
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 72/100
jessepollak/home#1454 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
opensearch-project/OpenSearch-Dashboards#12822 ·
Maintainer thường phản hồi trong vòng 1 ngày