Skip to content

Conversation

@jguz-pubnub
Copy link
Contributor

feat(channel-groups): add support for channel groups

@pubnub-ops-terraform
Copy link
Contributor

pubnub-ops-terraform commented Jul 23, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@jguz-pubnub jguz-pubnub force-pushed the feat/channel-groups branch 2 times, most recently from 96546bc to e8191d1 Compare July 23, 2025 11:59
@jguz-pubnub jguz-pubnub force-pushed the feat/channel-groups branch from e8191d1 to aec9fd6 Compare July 23, 2025 12:37
Copy link

@marcin-cebo marcin-cebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added few minor comments.

/// - completion: The async `Result` of the method call
/// - **Success**: A `Void` indicating a success
/// - **Failure**: An `Error` describing the failure
func add(channels: [ChatType.ChatChannelType], completion: ((Swift.Result<Void, Error>) -> Void)?)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about defining
typealias OperationResult = Swift.Result<Void, Error>
and use it in several places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's clearer to leave the Result type as-is, which also aligns with the convention used in the core SDK. In this context, introducing typealiases leads to obscure the actual return type, forcing the caller to dig deeper to understand what's being returned

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -203,7 +204,7 @@ public protocol Chat: AnyObject {
/// - filter: Expression used to filter the results. Returns only these channels whose properties satisfy the given expression are returned

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead:
Returns only these channels whose properties satisfy the given expression are returned

shouldn't be:
Returns only the channels whose properties satisfy the given expression.
?

Copy link
Contributor Author

@jguz-pubnub jguz-pubnub Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, makes sense. Something is off with the current comment. I will change it to what you suggest

/// Returns a paginated list of all existing channels in a given ``ChannelGroup``.
///
/// - Parameters:
/// - filter: Expression used to filter the results. Returns only these channels whose properties satisfy the given expression are returned

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead:
Returns only these channels whose properties satisfy the given expression are returned

shouldn't be:
Returns only the channels whose properties satisfy the given expression.
?

/// Returns a paginated list of all existing channels in a given ``ChannelGroup``.
///
/// - Parameters:
/// - filter: Expression used to filter the results. Returns only these channels whose properties satisfy the given expression are returned

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead:
Returns only these channels whose properties satisfy the given expression are returned

shouldn't be:
Returns only the channels whose properties satisfy the given expression.
?

)
}

public func connect(callback: @escaping (MessageImpl) -> Void) -> AutoCloseable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ok that this line is not consistent with ChannelGroup protocol:
func connect(callback: @escaping (ChatType.ChatMessageType) -> Void) -> AutoCloseable
?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's consistent. The escaping keyword here is required and means the closure can be called after the function it was passed to has returned

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@jguz-pubnub
Copy link
Contributor Author

@pubnub-release-bot release as 0.31.0

@jguz-pubnub jguz-pubnub merged commit 52cd7c3 into master Aug 1, 2025
9 of 13 checks passed
@jguz-pubnub jguz-pubnub deleted the feat/channel-groups branch August 1, 2025 15:47
@pubnub-release-bot
Copy link

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants