Repository navigation
fix: resolve empty directory migration failure - #846
Draft
pppanghu77 wants to merge 1 commit into
Draft
pppanghu77 wants to merge 1 commit into
pppanghu77 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pppanghu77 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThe PR fixes empty-directory migration by adding recursively discovered empty subdirectories to the transfer manifest and removing restore-time path truncation, allowing directories at any depth to migrate while preserving existing file and non-empty-directory behavior. Sequence diagram for empty-directory migrationsequenceDiagram
participant TransferHelper
participant QDirIterator
participant Manifest
participant SettingHelper
participant Destination
TransferHelper->>QDirIterator: QDirIterator(absPath, Subdirectories)
loop each subdirectory
QDirIterator-->>TransferHelper: next()
TransferHelper->>TransferHelper: entryInfoList(AllEntries)
alt empty subdirectory
TransferHelper->>Manifest: append(relPath)
end
end
SettingHelper->>Manifest: read user_file
loop each manifest path
SettingHelper->>Destination: setFile(path, filepath)
SettingHelper->>Destination: create directory at full source path
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
pppanghu77
marked this pull request as draft
October 29, 2026 20:27
1. Root cause: getTransferJson() only added top-level user-selected
items to user_file array, never recursively enumerating empty
subdirectories; setFile() source path construction using
filename.mid(filename.indexOf('/')) dropped the first path segment
for multi-level paths and lacked a separator for top-level paths
2. Fix: recursively enumerate empty subdirectories in
getTransferJson() and add them to user_file array; use
filepath + "/" + filename for correct source path construction
3. Impact: empty directories at any depth now migrate correctly;
no behavior change for files and non-empty directories
Log: fix empty directory migration failure during backup import
Influence:
1. Test backup and restore with empty directories at various depths
2. Verify files and non-empty directories still migrate correctly
3. Test cross-device migration with empty directories
fix: 修复数据迁移时空目录无法迁移的问题
1. 根因:getTransferJson() 仅将用户选中的顶层项加入 user_file
数组,未递归枚举空子目录;setFile() 中源路径构造使用
filename.mid(filename.indexOf('/')) 对多级路径丢弃首段、
对顶层路径缺少分隔符,导致源路径错误
2. 方案:在 getTransferJson() 中递归枚举空子目录并加入 user_file
数组;使用 filepath + "/" + filename 构造正确的源路径
3. 影响:任意深度的空目录现在都能正确迁移;对文件和非空目录
无行为变化
Log: 修复备份导入时空目录无法迁移的问题
Influence:
1. 测试不同深度空目录的备份与恢复
2. 验证文件和非空目录仍能正常迁移
3. 测试跨设备迁移场景下的空目录处理
Bug: https://pms.uniontech.com/bug-view-357381.html
PMS: BUG-357381
pppanghu77
force-pushed
the
agent/agent/d9302bc955fc
branch
from
October 29, 2026 21:50
11725fa to
86ce8aa
Compare
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.
fix: resolve empty directory migration failure
items to user_file array, never recursively enumerating empty
subdirectories; setFile() path truncation from commit a05c2ff
further broke deep directory source path construction
getTransferJson() and add them to user_file array; remove path
depth truncation in setFile() and restore correct source path
no behavior change for files and non-empty directories
Log: fix empty directory migration failure during backup import
Influence:
fix: 修复数据迁移时空目录无法迁移的问题
数组,未递归枚举空子目录;setFile() 中 a05c2ff 引入的路径
截断逻辑进一步破坏了深层目录的源路径构造
数组;移除 setFile() 中的路径深度截断逻辑,恢复正确的源路径构造
Log: 修复备份导入时空目录无法迁移的问题
Influence:
PMS: BUG-357381
Summary by Sourcery
Restore empty directories correctly during data migration without changing handling for files or non-empty directories.
Bug Fixes: