From a1fd4a1f8aa0f9188965424f1f885fe985c87220 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 7 Mar 2026 15:50:33 +0800 Subject: [PATCH] Tolerate attachment response field aliases --- .../cn/xiaobai/openclawapp/network/MobileGatewayDtos.kt | 8 ++++++++ docs/MVP_PROGRESS.md | 1 + 2 files changed, 9 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/network/MobileGatewayDtos.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/network/MobileGatewayDtos.kt index 3fe6797..4ce350a 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/network/MobileGatewayDtos.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/network/MobileGatewayDtos.kt @@ -1,6 +1,7 @@ package cn.xiaobai.openclawapp.network import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonNames @Serializable data class LoginRequestDto( @@ -75,12 +76,19 @@ data class UpdateDefaultAgentResponseDto( @Serializable data class UploadAttachmentResponseDto( + @JsonNames("accepted", "accept") val accepted: Boolean, + @JsonNames("sessionId", "session_id") val sessionId: String, + @JsonNames("attachmentId", "attachment_id") val attachmentId: String, + @JsonNames("fileName", "filename", "file_name") val fileName: String, + @JsonNames("contentType", "content_type") val contentType: String? = null, + @JsonNames("sizeBytes", "sizebytes", "size_bytes") val sizeBytes: Int, + @JsonNames("queuedAt", "queued_at") val queuedAt: String, ) diff --git a/docs/MVP_PROGRESS.md b/docs/MVP_PROGRESS.md index d0f1a17..a84148f 100644 --- a/docs/MVP_PROGRESS.md +++ b/docs/MVP_PROGRESS.md @@ -442,3 +442,4 @@ Android/iOS App - 2026-03-07:进一步把页面切换从“状态变量拼页面”收成显式 route:`OpenClawAppState` 现在用 `AppRoute`(Sessions / Status / Settings / Chat(sessionId))管理当前页面,详情页与首页切换不再依赖 `selectedTab + activeSessionId` 的隐式组合,后续继续加真正导航能力会顺很多。 - 2026-03-07:把详情页顶部导航头正式迁回 `Scaffold.topBar`:聊天页内部不再自己伪造导航栏,而是由 app 壳层根据 route 决定顶栏标题、返回、附件、刷新动作;这样详情页终于有了正经的二级页面导航结构。 - 2026-03-07:修正附件失败态的重试可见性:之前“重试”混在一排附件操作按钮最右侧,窄屏上很容易被挤掉;现在失败附件会单独前置一个主按钮“重新发送附件”,避免用户知道失败了却找不到怎么重发。 +- 2026-03-07:补了一层附件上传响应 DTO 兼容:客户端 `UploadAttachmentResponseDto` 现在同时接受 `accepted/accept`、`fileName/filename`、`sizeBytes/sizebytes`、camelCase/snake_case 等字段名,先兜住线上回包字段不一致导致的反序列化失败。