Skip to content

Commit ce5bd49

Browse files
fixed duplicate method definition
1 parent dd4e71d commit ce5bd49

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

lib/stream-chat/client.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -940,16 +940,6 @@ def query_threads(filter, sort: nil, **options)
940940
post('threads', data: params)
941941
end
942942

943-
sig { params(filter: StringKeyHash, sort: T.nilable(T::Hash[String, Integer]), options: T.untyped).returns(StreamChat::StreamResponse) }
944-
def query_threads(filter, sort: nil, **options)
945-
params = {}.merge(options).merge({
946-
filter: filter,
947-
sort: StreamChat.get_sort_fields(sort)
948-
})
949-
950-
post('threads', data: params)
951-
end
952-
953943
# Creates a reminder for a message.
954944
# @param message_id [String] The ID of the message to create a reminder for
955945
# @param user_id [String] The ID of the user creating the reminder

spec/client_spec.rb

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,66 +1021,6 @@ def loop_times(times)
10211021
end
10221022
end
10231023

1024-
describe '#query_threads' do
1025-
before(:all) do
1026-
# Create a dedicated random user for this block
1027-
@thread_test_user = { id: SecureRandom.uuid }
1028-
@client.upsert_users([@thread_test_user])
1029-
1030-
# Create a channel and send a message to create a thread
1031-
@thread_channel = @client.channel('messaging', channel_id: SecureRandom.uuid, data: { test: true })
1032-
@thread_channel.create(@thread_test_user[:id])
1033-
1034-
# Send a message to create a thread
1035-
@thread_message = @thread_channel.send_message({ text: 'Thread parent message' }, @thread_test_user[:id])
1036-
1037-
# Send a reply to create a thread
1038-
@thread_channel.send_message({ text: 'Thread reply', parent_id: @thread_message['message']['id'] }, @thread_test_user[:id])
1039-
end
1040-
1041-
after(:all) do
1042-
@thread_channel.delete
1043-
@client.delete_user(@thread_test_user[:id])
1044-
end
1045-
1046-
it 'queries threads with filter' do
1047-
filter = {
1048-
'created_by_user_id' => { '$eq' => @thread_test_user[:id] }
1049-
}
1050-
1051-
response = @client.query_threads(filter, user_id: @thread_test_user[:id])
1052-
1053-
expect(response).to include 'threads'
1054-
expect(response['threads'].length).to be >= 1
1055-
end
1056-
1057-
it 'queries threads with sort' do
1058-
sort = {
1059-
'created_at' => -1
1060-
}
1061-
1062-
response = @client.query_threads({}, sort: sort, user_id: @thread_test_user[:id])
1063-
1064-
expect(response).to include 'threads'
1065-
expect(response['threads'].length).to be >= 1
1066-
end
1067-
1068-
it 'queries threads with both filter and sort' do
1069-
filter = {
1070-
'created_by_user_id' => { '$eq' => @thread_test_user[:id] }
1071-
}
1072-
1073-
sort = {
1074-
'created_at' => -1
1075-
}
1076-
1077-
response = @client.query_threads(filter, sort: sort, user_id: @thread_test_user[:id])
1078-
1079-
expect(response).to include 'threads'
1080-
expect(response['threads'].length).to be >= 1
1081-
end
1082-
end
1083-
10841024
describe 'reminders' do
10851025
before do
10861026
@client = StreamChat::Client.from_env

0 commit comments

Comments
 (0)