Support skipPush and silent system messages in addMembers / removeMembers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with Sources/StreamChat/APIClient/Endpoints/ChannelEndpoints.swift and trace the controller and async Chat state-layer addMembers/removeMembers APIs, including the public SystemMessage type. Verify how request bodies encode skip_push and message.silent, then add coverage for true, false, and default values. Done means all listed API variants support both options, existing calls still compile, and documentation includes the requested example.
Written by the indexing model from the issue text.
Description
The Android SDK allows developers to control push notifications and unread counts when adding or removing channel members by providing:
skipPushonaddMembersandremoveMembers- A system
Messagewhosesilentproperty can be set explicitly
The Swift SDK does not currently expose equivalent options. It would be helpful to provide feature parity between the Android and Swift SDKs.
Current Swift API
In Swift SDK 5.7.0, the controller API accepts a system message as a String, but does not expose either skipPush or isSilent:
channelController.addMembers(
userIds: ["user-1"],
message: "User joined"
)
channelController.removeMembers(
userIds: ["user-1"],
message: "User left"
)
The underlying endpoint request also does not include skip_push:
static func addMembers(
cid: ChannelId,
members: [MemberInfo],
hideHistory: Bool,
hideHistoryBefore: Date?,
messagePayload: MessageRequestBody?
) -> Endpoint<EmptyResponse>
static func removeMembers(
cid: ChannelId,
userIds: [UserId],
messagePayload: MessageRequestBody?
) -> Endpoint<EmptyResponse>
Source: ChannelEndpoints.swift
The develop branch introduces a public SystemMessage type, but it still does not allow callers to specify whether the message is silent:
public struct SystemMessage: Equatable, Sendable {
public var text: String
public var extraData: [String: RawJSON]
public init(
text: String,
extraData: [String: RawJSON] = [:]
)
}
Android SDK API
The Android SDK already exposes skipPush for both operations:
public fun addMembers(
memberIds: List<String>,
systemMessage: Message? = null,
hideHistory: Boolean? = null,
hideHistoryBefore: Date? = null,
skipPush: Boolean? = null,
): Call<Channel>
public fun removeMembers(
memberIds: List<String>,
systemMessage: Message? = null,
skipPush: Boolean? = null,
): Call<Channel>
The system message can also be marked as silent:
val systemMessage = Message(
text = "User joined",
silent = true,
)
channelClient.addMembers(
memberIds = listOf("user-1"),
systemMessage = systemMessage,
skipPush = true,
).enqueue()
channelClient.removeMembers(
memberIds = listOf("user-1"),
systemMessage = systemMessage,
skipPush = true,
).enqueue()
Sources:
Proposed Swift API
Extend SystemMessage so callers can explicitly create a silent system message:
public struct SystemMessage: Equatable, Sendable {
public var text: String
public var isSilent: Bool
public var extraData: [String: RawJSON]
public init(
text: String,
isSilent: Bool = false,
extraData: [String: RawJSON] = [:]
) {
self.text = text
self.isSilent = isSilent
self.extraData = extraData
}
}
Expose skipPush through the member-management APIs:
public func addMembers(
userIds: Set<UserId>,
hideHistory: Bool = false,
hideHistoryBefore: Date? = nil,
systemMessage: SystemMessage? = nil,
skipPush: Bool = false,
completion: ((Error?) -> Void)? = nil
)
public func removeMembers(
userIds: Set<UserId>,
systemMessage: SystemMessage? = nil,
skipPush: Bool = false,
completion: ((Error?) -> Void)? = nil
)
The same options should also be available in:
- The
[MemberInfo]overloads - The async
Chatstate-layer APIs - Any other public
addMembersorremoveMembersvariants
Example usage:
let systemMessage = SystemMessage(
text: "User joined",
isSilent: true
)
channelController.addMembers(
userIds: ["user-1"],
systemMessage: systemMessage,
skipPush: true
)
channelController.removeMembers(
userIds: ["user-1"],
systemMessage: SystemMessage(
text: "User left",
isSilent: true
),
skipPush: true
)
Expected request mapping
skipPushshould be serialized as the top-levelskip_pushproperty.SystemMessage.isSilentshould be serialized as the nested message'ssilentproperty.
For example:
{
"add_members": ["user-1"],
"skip_push": true,
"message": {
"text": "User joined",
"silent": true
}
}
Expected behavior
skipPush: trueprevents push notifications generated by the optional system message.isSilent: trueprevents the system message from increasing unread counts or marking the channel as unread.- Both properties default to
falseto preserve existing behavior and source compatibility.
Acceptance criteria
addMembersandremoveMembersexposeskipPush.SystemMessageexposesisSilent.- The values are correctly serialized to
skip_pushandmessage.silent. - Controller and async state-layer APIs both support the options.
- Existing calls continue to compile without modification.
- Request-body tests cover
true,false, and default values. - Documentation includes an example of adding or removing members without push notifications or unread-count changes.
This would bring the Swift SDK member-management API in line with the Android SDK.
- Dominant language
- Swift
- Stars
- 975
- Forks
- 236
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 46
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GetStream/stream-chat-swift
-
[Bug]: iOS SDK player remains stuck loading a WebM attachment sent by an Android SDK clientPossibly taken @mvanhorn claimed this 65 days ago. Open🐞 Bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
GetStream/stream-chat-swift#4281 · 1 comment ·
Maintainers usually reply within 1 day
-
Crash on Real Device at Launch: dyld Symbol Not Found for ChatChannelListViewModel.handleHideTabBarOpen🔎 Investigating
Difficulty 4/5 3-5 days Newbie friendliness 45/100
GetStream/stream-chat-swift#4166 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
[Bug]: Voice recording doesnt stop sometimes when user plays an recording or opens an attachmentOpen🐞 Bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
GetStream/stream-chat-swift#3678 · 1 comment ·
Maintainers usually reply within 1 day
All issues in GetStream/stream-chat-swift
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug priority:low status:queued
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Insights trim drops today's rollups before newer DNS answers during a DNS floodPossibly taken A pull request linked to this issue is open or already merged. Openbug priority:low status:in-progress
Difficulty 2/5 Half a day Newbie friendliness 67/100
isaaclins/freesnitch#588 ·
Maintainers usually reply within 1 day
-
bug P2: medium
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
leepokai/Codync#618 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
floorianmb/tidywise#5 ·