| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor: pass IRequest reference to ShouldCancelOnNewRequest and hoist templateId to BaseRequest Signed-off-by: Tianshi Liu <tianshi.liu@huawei.com> Change-Id: I5bf194f53cfc7b5dab5f9068da55688eb049c3b5 | 2 个月前 | |
!224 merge dev4 into master fix: 加固请求完成生命周期与事件采集字段 Created-by: tianshiliu25 Commit-by: Tianshi Liu Merged-by: openharmony_ci Description: ## 变更摘要 本次变更主要加固跨设备认证请求的完成生命周期,使终态完成(CompleteWithError / CompleteWithSuccess)成为一次性操作,避免重复或重入触发的二次回调与重复销毁;同时修复若干由 move 语义导致的悬空回调、错误码未正确传播等问题,并丰富交互事件采集字段、加固内存分配。 ## 影响范围 - **请求完成生命周期加固**(common/base_request 及各 host/companion request):BaseRequest 新增 completed_ 标志与 AcquireCompletion(),所有请求类型的完成函数加入一次性守卫,防止重复/重入完成;HostAddCompanionRequest 在 enrollmentSucceeded_ 路径下内联成功完成逻辑;HostRemoveHostBindingRequest 即使无 templateId 也继续上报事件并销毁。 - **delegate_auth 委托认证**:HandleDelegateAuthResult 增加 cancelled_ 早退避免迟到回调;发送失败通过 ErrorGuard 设置 COMMUNICATION_ERROR;回复处理统一走 ErrorGuard 错误码。 - **issue_token**:预下发消息发送失败改用 COMMUNICATION_ERROR 而非 GENERAL_ERROR。 - **move 语义修复**:local_device_status_manager callback 改拷贝入表、companion_init_key_negotiation_handler / host_pre_obtain_token_handler 的 OnMessageReply 改拷贝传递,避免延迟任务/ErrorGuard 引用到 moved-from 对象。 - **sync_device_status**:SetConnectionName 由构造函数移至 OnConnected(),确保连接名有效。 - **事件采集**:InteractionEventCollector 新增 callerUserId 字段;InteractionDesc 中 pkgName 仅保留末段以缩短日志。 - **内存分配加固**:rsa_oaep_encryptor、companion_device_auth_all_in_one_executor 使用 new(std::nothrow) + ENSURE_OR_RETURN_VAL。 - **测试**:补充完成幂等性、callerUserId 编码及 subscription_util 边界逻辑的单元测试。 Closes #179 See merge request: openharmony/useriam_companion_device_auth!224 | 1 个月前 |