Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageAction enum changes #2005

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
Loading