Repository navigation
fix(download): 修复归档下载器丢下载或放错文件的问题,并处理 dataSync 超时 - #175
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
onTimeout:暂停全部任务(归档之后用 Range 续传),停前台并stopSelf;手机下载等同于通知里的「全部停止」startForeground被拒时不再崩溃(时长用完后再启动会抛ForegroundServiceStartNotAllowedException),被拒期间也不留下停服务后撤不掉的常驻通知<标题>_<gid>.zip,同名画廊不再互相删除或续传对方的文件;导入完成的提示仍显示画廊标题。不迁移旧文件(旧的<标题>.zip可能属于另一本同名画廊),2.0.2.4-hl.1 和 2.0.2.5-hl.1 里暂停着的归档下载更新后从头下载验证:LXC 上 CI 同款构建通过,单测 406 个 0 失败,release 构建的 lintVital 通过;新增测试都做过变异验证,19 个变异体全部被抓到。平板(SM-X926B,Android 16)上把 dataSync 时长临时调成 3 秒:手机下载和归档下载在后台都被系统超时并停下,没有崩溃,归档暂停后用 Range 接着下完;超时后重启服务时
startForeground确实抛了 Time limit already exhausted,被兜住。两本同名画廊在后台同时下归档,zip 各自命名、大小与单独下载一致,第一本下完时前台服务一直保持到第二本结束。堵住外部 archiver/temp 目录后,zip 落在应用缓存、导入成功、zip 被删掉。未验证:没有真的撤销「所有文件访问」(这台平板的下载位置依赖该权限,撤掉后所有下载都会失败),用堵住两个目录代替;SMB 服务的
onTimeout只有单测,设备上会写进真实的库。Closes #166