Skip to content

Fix task log parsing error handling and bump to v0.6.1#123

Merged
fslongjin merged 2 commits intoDragonOS-Community:mainfrom
fslongjin:fix-task-log-parsing-error-handling
Feb 10, 2026
Merged

Fix task log parsing error handling and bump to v0.6.1#123
fslongjin merged 2 commits intoDragonOS-Community:mainfrom
fslongjin:fix-task-log-parsing-error-handling

Conversation

@fslongjin
Copy link
Member

@fslongjin fslongjin commented Feb 10, 2026

fix(cache): 改进任务日志读取的错误处理并添加兼容性测试

  • task_log方法中,将直接使用unwrap改为使用match
    进行错误处理,当读取或解析失败时记录警告并返回默认的TaskLog
  • TaskLog结构体的build_time字段上添加default
    属性,以支持反序列化旧版本中缺失该字段的任务日志
  • 添加单元测试should_deserialize_legacy_task_log_without_build_timestamp
    ,确保能正确读取旧格式的任务日志

- 在`task_log`方法中,将直接使用`unwrap`改为使用`match`
进行错误处理,当读取或解析失败时记录警告并返回默认的`TaskLog`
- 在`TaskLog`结构体的`build_time`字段上添加`default`
属性,以支持反序列化旧版本中缺失该字段的任务日志
- 添加单元测试`should_deserialize_legacy_task_log_without_build_timestamp`
,确保能正确读取旧格式的任务日志

Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@DragonOS.org>
@fslongjin fslongjin merged commit 3c2246f into DragonOS-Community:main Feb 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant