Files
openclaw/apps/ios/Tests/ChatSessionsCodingTests.swift
RoboClaw 44d60a29e6 fix: preserve unread reminder for open sessions (#129386)
* fix: preserve manual unread markers in open sessions

* fix: distinguish explicit session reads

* fix(ui): gate unread contract on gateway capability

* perf(ui): keep server capabilities out of startup bundle

* test(gateway): keep agent fixtures roster-consistent

* fix(sessions): preserve legacy read compatibility

* test(gateway): type agent fixture configs

* fix(ui): remove unread gateway fallback

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>

* test(infra): avoid fixed SSH tunnel port

* fix(ui): acknowledge unread after history commit

* docs: clarify unread upgrade boundary

* test(ui): drive mobile session menu by tap

* fix(ios): remove stale read reconciliation call

---------

Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-08-26 05:04:39 -07:00

33 lines
1.0 KiB
Swift

import Foundation
import OpenClawChatUI
import Testing
struct ChatSessionsCodingTests {
@Test func `decodes session organization and read state fields`() throws {
let data = Data(#"""
{
"key":"agent:main:telegram:group:1",
"label":"Release room",
"category":"Operations",
"pinned":true,
"archived":false,
"unread":true,
"lastReadAt":1720000000000,
"markedUnreadAt":1720000002500,
"lastActivityAt":1720000005000
}
"""#.utf8)
let entry = try JSONDecoder().decode(OpenClawChatSessionEntry.self, from: data)
#expect(entry.label == "Release room")
#expect(entry.category == "Operations")
#expect(entry.pinned == true)
#expect(entry.archived == false)
#expect(entry.unread == true)
#expect(entry.lastReadAt == 1_720_000_000_000)
#expect(entry.markedUnreadAt == 1_720_000_002_500)
#expect(entry.lastActivityAt == 1_720_000_005_000)
}
}