Repository navigation
fix(h5): clear download timeout after completion - #19532
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
Changes下载请求超时清理
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19532 +/- ##
==========================================
+ Coverage 55.36% 55.58% +0.22%
==========================================
Files 467 467
Lines 25652 25654 +2
Branches 6423 6390 -33
==========================================
+ Hits 14201 14259 +58
+ Misses 9493 9401 -92
- Partials 1958 1994 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
这个 PR 做了什么?
Closes #19531
H5
downloadFile在成功或网络错误后仍保留超时定时器,之后会再次触发fail/complete。本 PR 在xhr.onload和xhr.onerror中清除该定时器。新增 4 个回归用例,覆盖成功、网络错误、取消和超时,检查定时器清理及回调次数。修复前成功/错误 2 个用例失败,修复后 4 个全部通过。
这个 PR 是什么类型?
这个 PR 涉及以下平台:
验证
pnpm --filter @tarojs/taro-h5 exec jest --watchman=false --runInBand __tests__/network/download.test.ts:4 个用例通过。Summary by CodeRabbit