-
Notifications
You must be signed in to change notification settings - Fork 25
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
[ECO-4933] Added readonly ARTChannelProperties
object to the public interface
#1965
Conversation
WalkthroughThe changes introduce a new Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- Source/ARTRealtimeChannel.m (3 hunks)
- Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h (2 hunks)
- Source/include/Ably/ARTRealtimeChannel.h (3 hunks)
- Test/Tests/RealtimeClientChannelTests.swift (1 hunks)
Additional context used
SwiftLint
Test/Tests/RealtimeClientChannelTests.swift
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Additional comments not posted (8)
Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h (2)
37-37
: Approved addition ofproperties_nosync
method.This method provides a non-synchronized way to access channel properties, potentially improving performance in scenarios where thread safety is managed externally.
101-101
: Approved the new initializer forARTChannelProperties
.The initializer allows setting
attachSerial
andchannelSerial
directly, which is essential for managing channel state accurately.Source/include/Ably/ARTRealtimeChannel.h (2)
14-14
: Approved the introduction ofARTChannelProperties
class and its properties.The new class and its properties (
attachSerial
andchannelSerial
) encapsulate channel state information effectively, enhancing clarity and manageability of channel-related data.Also applies to: 157-164
32-32
: Approved the addition ofproperties
inARTRealtimeChannel
.This property provides a straightforward way to access channel properties, improving the API's usability and aligning with the objectives of enhancing channel management.
Source/ARTRealtimeChannel.m (3)
72-74
: Approved the addition of synchronized and non-synchronizedproperties
methods.These methods provide both thread-safe and efficient access to channel properties, enhancing the API's flexibility and safety.
Also applies to: 1085-1091
1093-1095
: Approved theproperties_nosync
method implementation.This method correctly initializes
ARTChannelProperties
withattachSerial
andchannelSerial
, aligning with the intended use of these properties for channel state management.
1142-1148
: Approved the initializer forARTChannelProperties
.This implementation correctly assigns
attachSerial
andchannelSerial
, ensuring that channel properties are initialized accurately.Test/Tests/RealtimeClientChannelTests.swift (1)
4259-4266
: Ensure proper handling of channel serial updates in message and presence actions.The tests correctly verify that the
channelSerial
is updated whenever a protocol message with a message, presence, or attached action is received. This aligns with the specification [RTL15b]. Ensure that the implementation of message handling in the SDK properly updates thechannelSerial
to maintain state consistency.Also applies to: 4274-4274
Tools
SwiftLint
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
…not touching existing internal properties `attachSerial` and `channelSerial` (from which it's being constructed with a private constructor for each call).
c727208
to
fbe2e92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- Source/ARTRealtimeChannel.m (3 hunks)
- Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h (2 hunks)
- Source/include/Ably/ARTRealtimeChannel.h (3 hunks)
- Test/Tests/RealtimeClientChannelTests.swift (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- Source/ARTRealtimeChannel.m
- Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h
- Source/include/Ably/ARTRealtimeChannel.h
Additional context used
SwiftLint
Test/Tests/RealtimeClientChannelTests.swift
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Additional comments not posted (2)
Test/Tests/RealtimeClientChannelTests.swift (2)
4259-4266
: UpdatedchannelSerial
references look good.The changes correctly update the assertions to use
channel.properties.channelSerial
, aligning with the PR's objectives to shift from internal state references to properties access methods.Tools
SwiftLint
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
4274-4274
: Consistent update forchannelSerial
access.This change is consistent with the previous updates and correctly uses
channel.properties.channelSerial
for assertions.
ARTChannelProperties
object to the public interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- Test/Tests/RealtimeClientChannelTests.swift (3 hunks)
Additional context used
SwiftLint
Test/Tests/RealtimeClientChannelTests.swift
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Additional comments not posted (6)
Test/Tests/RealtimeClientChannelTests.swift (6)
4259-4266
: Consider adding more comprehensive tests for channel serial updates.While the current tests check the basic functionality, consider adding more scenarios that involve complex interactions or error conditions to ensure the
channelSerial
is robustly handled across different states and edge cases.Would you like me to help create additional test cases or enhance the existing ones to cover more scenarios?
Tools
SwiftLint
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
4259-4266
: Add validation for the absence ofchannelSerial
when not expected.The tests currently check for the presence of
channelSerial
when expected. It would be beneficial to also explicitly validate cases wherechannelSerial
should not be present to ensure that it is not incorrectly set in those scenarios.I can help implement these additional checks if you agree it's beneficial.
Tools
SwiftLint
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
4259-4266
: Improve error handling in channel serial update tests.Consider adding more robust error handling in the tests to catch and report errors related to channel serial updates. This could help in identifying issues during the testing phase before they affect production environments.
Let me know if you need assistance in implementing enhanced error handling for these tests.
Tools
SwiftLint
[Warning] 4263-4263: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
4274-4274
: Consider adding more comprehensive tests for channel serial updates.While the current tests check the basic functionality, consider adding more scenarios that involve complex interactions or error conditions to ensure the
channelSerial
is robustly handled across different states and edge cases.Would you like me to help create additional test cases or enhance the existing ones to cover more scenarios?
4274-4274
: Add validation for the absence ofchannelSerial
when not expected.The tests currently check for the presence of
channelSerial
when expected. It would be beneficial to also explicitly validate cases wherechannelSerial
should not be present to ensure that it is not incorrectly set in those scenarios.I can help implement these additional checks if you agree it's beneficial.
4274-4274
: Improve error handling in channel serial update tests.Consider adding more robust error handling in the tests to catch and report errors related to channel serial updates. This could help in identifying issues during the testing phase before they affect production environments.
Let me know if you need assistance in implementing enhanced error handling for these tests.
80180c3
to
fee7703
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
Test/Tests/RealtimeClientChannelTests.swift (1)
4264-4264
: Replace unused closure parameter with_
.The closure parameter
presenceMessage
is not used and should be replaced with_
to avoid warnings.Apply this diff to fix the issue:
- channel.presence.subscribe { presenceMessage in + channel.presence.subscribe { _ inTools
SwiftLint
[Warning] 4264-4264: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- Source/ARTRealtimeChannel.m (4 hunks)
- Test/Tests/RealtimeClientChannelTests.swift (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- Source/ARTRealtimeChannel.m
Additional context used
SwiftLint
Test/Tests/RealtimeClientChannelTests.swift
[Warning] 4264-4264: Unused parameter in a closure should be replaced with _
(unused_closure_parameter)
Additional comments not posted (1)
Test/Tests/RealtimeClientChannelTests.swift (1)
Line range hint
4281-4281
: LGTM!The code changes are approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- Source/include/Ably/ARTRealtimeChannel.h (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- Source/include/Ably/ARTRealtimeChannel.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once @lawrence-forooghian is happy with the open conversations
Added readonly ARTChannelProperties object to the public interface not touching existing internal properties
attachSerial
andchannelSerial
(from which it's being constructed with a private constructor for each call).Closes #1960
Summary by CodeRabbit
New Features
ARTChannelProperties
class with a dedicated initializer for improved encapsulation of channel properties.properties
property toARTRealtimeChannel
for better access to channel state.Bug Fixes