CodeChefVIT / CodeChefVIT/papers-codechef
[BUG] Zip download missing extension, silent fail on empty
- 主要语言
- TypeScript
- 星标
- 20
- 派生
- 64
- PR 合并指标
- 30 天内没有已合并 PR
描述
**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.
贡献指南
调研方向
从 src/context/filterContext.tsx 开始,检查第 150–164 行的 fetch 失败处理,以及第 180 行的下载文件名。使用多篇 papers 重现 Catalogue 下载,包括所有请求都失败的网络情况,并验证文件名具有 .zip 扩展名、失败会产生 error toast,以及部分成功会报告已下载的数量。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 78/100