Skip to content

Commit

Permalink
MessageAction enum changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed Jan 8, 2025
1 parent aca9a7c commit c01363f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
17 changes: 5 additions & 12 deletions Source/include/Ably/ARTMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
*/
NS_SWIFT_SENDABLE
typedef NS_ENUM(NSUInteger, ARTMessageAction) {
/**
* Message action has not been set.
*/
ARTMessageActionUnset,
/**
* Message action for a newly created message.
*/
Expand All @@ -25,18 +21,15 @@ typedef NS_ENUM(NSUInteger, ARTMessageAction) {
* Message action for a deleted message.
*/
ARTMessageActionDelete,
/**
* Message action for a newly created annotation.
*/
ARTMessageActionAnnotationCreate,
/**
* Message action for a deleted annotation.
*/
ARTMessageActionAnnotationDelete,
/**
* Message action for a meta-message that contains channel occupancy information.
*/
ARTMessageActionMetaOccupancy,
/**
* Message action for a message containing the latest rolled-up summary of
* annotations that have been made to this message..
*/
ARTMessageActionMessageSummary,
};

NS_ASSUME_NONNULL_BEGIN
Expand Down
12 changes: 6 additions & 6 deletions Test/Tests/UtilitiesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class UtilitiesTests: XCTestCase {
{
"messages": [
{
"action": 1,
"action": 0,
"version": "123"
}
]
Expand All @@ -510,7 +510,7 @@ class UtilitiesTests: XCTestCase {
{
"messages": [
{
"action": 0,
"action": 1,
"version": "123"
}
]
Expand All @@ -519,7 +519,7 @@ class UtilitiesTests: XCTestCase {
data = json.data(using: .utf8)!
pm = try jsonEncoder.decodeProtocolMessage(data)
messages = try XCTUnwrap(pm.messages)
XCTAssert(messages[0].action == .unset)
XCTAssert(messages[0].action == .update)
XCTAssert(messages[0].version == "123")
XCTAssertNil(messages[0].serial)
}
Expand Down Expand Up @@ -558,7 +558,7 @@ class UtilitiesTests: XCTestCase {
{
"messages": [
{
"action": 1,
"action": 0,
"timestamp": "1234512345",
}
]
Expand All @@ -576,7 +576,7 @@ class UtilitiesTests: XCTestCase {
{
"messages": [
{
"action": 0,
"action": 1,
"timestamp": "1234512345",
}
]
Expand All @@ -585,7 +585,7 @@ class UtilitiesTests: XCTestCase {
data = json.data(using: .utf8)!
pm = try jsonEncoder.decodeProtocolMessage(data)
messages = try XCTUnwrap(pm.messages)
XCTAssert(messages[0].action == .unset)
XCTAssert(messages[0].action == .update)
XCTAssertNil(messages[0].createdAt)
}
}

0 comments on commit c01363f

Please sign in to comment.