CodeChefVIT / CodeChefVIT/papers-codechef

[BUG] Zip download missing extension, silent fail on empty

Đang mở Phù hợp với người mới
#523 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
20
Fork
64
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
Zip download lacks file extension and shows success even when download fails entirely.

**To Reproduce**
1. Go to Catalogue page
2. Select 2+ papers
3. Click "Download Selected"
4. (Optional: throttle network in DevTools to simulate all requests failing)
5. File downloads with no `.zip` extension
6. If all fetches failed, empty ZIP is created but success toast still appears

**Expected behavior**
- Downloaded file should have `.zip` extension (e.g., `Physics.zip`)
- If all paper fetches fail, show error toast instead of success
- Success message should show count: "Downloaded 3 of 5 papers"

**Screenshots**
N/A (UX issue — filename shows `Physics` not `Physics.zip` in downloads folder)

**Desktop**
- OS: Any
- Browser: Chrome/Firefox/Safari
- Issue occurs on all browsers

**Root cause**
File: `src/context/filterContext.tsx`
- Line 180: `a.download = getDownloadName(...)` missing `.zip`
- Lines 150–164: Fetch errors silently caught, no success counter
- Line 186: Always shows success toast regardless of download state

**Additional context**
Low severity — UX friction, not data loss. User gets empty ZIP but can retry.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start in src/context/filterContext.tsx, checking lines 150–164 for fetch failure handling and line 180 for the download filename. Reproduce the Catalogue download with multiple papers, including an all-fail network case, and verify the filename has a .zip extension, failures produce an error toast, and partial success reports the downloaded count.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
78/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.