Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
description of repo status
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
18
Star
18
Fork
222
OpenHarmony
/
request_request
Closed
Code
Issues
6
Pull Requests
10
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
request.download 下载时概率不上报complete事件
Done
#I5WZC6
Bug
haomini
Opened this issue
2022-10-21 15:36
**【模块名_概率】简要描述:** request.download 下载时概率不上报complete事件 **【环境信息】:** - 网络环境: 有线网络 - 硬件开发板型号 - 软件版本信息或tag节点: 3.1release repo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony-3.1-Release --no-repo-verify - 测试环境 - 其他 **【预置条件】:** 通过如下方式下载文件时, 当下载任务较多时, 会出现文件已完成下载, 但complete事件未回调 ``` var count = 0 export class Downloader { private downloadTask constructor() { } public downloadFile(url: string, file: string, listener: () => void) { request.download({ url: url, filePath: file }).then(task => { this.downloadTask = task this.downloadTask.on('complete', () => { count = count + 1 console.info(`download ${file} success ${count}`); listener() }) this.downloadTask.on('fail', (err) => { console.error(`download ${file} failed, err: ` + JSON.stringify(err)) }) }).catch(err => { console.error(`download create download task failed, err: ` + JSON.stringify(err)) }) } } ``` **【测试步骤】:** **【预期结果】:** 多个下载任务结束时, 正常回调complete事件 **【实际结果】:** 多个下载任务结束时, 概率出现回调complete事件不回调 **【恢复手段】:** 无 **【出现概率】:问题出现次数/实际测试次数** **【定位信息】:** 下载任务结束时, 从日志上看 下载任务完成时, 概率出现设置的回调事件还没设置 Line 4490: 01-01 03:18:07.526 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1558 [0, 0]. Line 4517: 01-01 03:18:07.532 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1561 [0, 0]. Line 4558: 01-01 03:18:07.539 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1562 [0, 0]. Line 4617: 01-01 03:18:07.547 2272 2309 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1563 [0, 0]. Line 4618: 01-01 03:18:07.547 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1565 [0, 0]. Line 4691: 01-01 03:18:07.573 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1570 [0, 0]. Line 4852: 01-01 03:18:07.589 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1575 [0, 0]. Line 4984: 01-01 03:18:07.604 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1576 [0, 0]. Line 5303: 01-01 03:18:07.624 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1577 [0, 0]. Line 5556: 01-01 03:18:07.636 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1578 [0, 0]. Line 5845: 01-01 03:18:07.650 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1579 [0, 0]. Line 6196: 01-01 03:18:07.665 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1580 [0, 0]. Line 6490: 01-01 03:18:07.680 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1558 Line 6523: 01-01 03:18:07.681 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1581 [0, 0]. Line 6614: 01-01 03:18:07.685 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1559 Line 6715: 01-01 03:18:07.691 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1560 Line 6719: 01-01 03:18:07.691 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1582 [0, 0]. Line 6785: 01-01 03:18:07.696 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1561 Line 6846: 01-01 03:18:07.701 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1562 - 1. Log、截图、多媒体文件等,所有和问题有关的信息: log: [丢失时日志](https://gitee.com/haozhoum/misc_res/blob/master/data/hilog/download_completed_lose.log)
**【模块名_概率】简要描述:** request.download 下载时概率不上报complete事件 **【环境信息】:** - 网络环境: 有线网络 - 硬件开发板型号 - 软件版本信息或tag节点: 3.1release repo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony-3.1-Release --no-repo-verify - 测试环境 - 其他 **【预置条件】:** 通过如下方式下载文件时, 当下载任务较多时, 会出现文件已完成下载, 但complete事件未回调 ``` var count = 0 export class Downloader { private downloadTask constructor() { } public downloadFile(url: string, file: string, listener: () => void) { request.download({ url: url, filePath: file }).then(task => { this.downloadTask = task this.downloadTask.on('complete', () => { count = count + 1 console.info(`download ${file} success ${count}`); listener() }) this.downloadTask.on('fail', (err) => { console.error(`download ${file} failed, err: ` + JSON.stringify(err)) }) }).catch(err => { console.error(`download create download task failed, err: ` + JSON.stringify(err)) }) } } ``` **【测试步骤】:** **【预期结果】:** 多个下载任务结束时, 正常回调complete事件 **【实际结果】:** 多个下载任务结束时, 概率出现回调complete事件不回调 **【恢复手段】:** 无 **【出现概率】:问题出现次数/实际测试次数** **【定位信息】:** 下载任务结束时, 从日志上看 下载任务完成时, 概率出现设置的回调事件还没设置 Line 4490: 01-01 03:18:07.526 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1558 [0, 0]. Line 4517: 01-01 03:18:07.532 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1561 [0, 0]. Line 4558: 01-01 03:18:07.539 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1562 [0, 0]. Line 4617: 01-01 03:18:07.547 2272 2309 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1563 [0, 0]. Line 4618: 01-01 03:18:07.547 2272 2311 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1565 [0, 0]. Line 4691: 01-01 03:18:07.573 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1570 [0, 0]. Line 4852: 01-01 03:18:07.589 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1575 [0, 0]. Line 4984: 01-01 03:18:07.604 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1576 [0, 0]. Line 5303: 01-01 03:18:07.624 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1577 [0, 0]. Line 5556: 01-01 03:18:07.636 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1578 [0, 0]. Line 5845: 01-01 03:18:07.650 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1579 [0, 0]. Line 6196: 01-01 03:18:07.665 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1580 [0, 0]. Line 6490: 01-01 03:18:07.680 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1558 Line 6523: 01-01 03:18:07.681 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1581 [0, 0]. Line 6614: 01-01 03:18:07.685 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1559 Line 6715: 01-01 03:18:07.691 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1560 Line 6719: 01-01 03:18:07.691 2272 2310 I 01c00/Downloadkit: [download_service_ability.cpp NotifyHandler 247] DownloadServiceAbility::NotifyHandler started complete-1582 [0, 0]. Line 6785: 01-01 03:18:07.696 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1561 Line 6846: 01-01 03:18:07.701 2272 2272 I 01c00/Downloadkit: [download_service_ability.cpp On 195] DownloadServiceAbility::On started. type=complete-1562 - 1. Log、截图、多媒体文件等,所有和问题有关的信息: log: [丢失时日志](https://gitee.com/haozhoum/misc_res/blob/master/data/hilog/download_completed_lose.log)
Comments (
4
)
Sign in
to comment
Status
Done
Backlog
Confirmed
技术评审中
Fixing
验收中
Done
Canceled
Declined
挂起
Assignees
Not set
Labels
Not set
Projects
Unprojected
Unprojected
Milestones
OpenHarmony_3.1_Maintenance
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(2)
C++
1
https://gitee.com/openharmony/request_request.git
git@gitee.com:openharmony/request_request.git
openharmony
request_request
request_request
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register