Closed AlaaAbdelbaki closed 3 months ago
same here any update?
We had to update the package internally in the channels_api.dart file we replaced the queryChannels method with this one We replaced it from this:
/// THIS IS THE OLD FUNCTION THAT'S CAUSING THE ERROR
/// Line 50
/// Requests channels with a given query from the API.
Future<QueryChannelsResponse> queryChannels({
Filter? filter,
List<SortOption>? sort,
int? memberLimit,
int? messageLimit,
bool state = true,
bool watch = true,
bool presence = false,
PaginationParams paginationParams = const PaginationParams(),
}) async {
final response = await _client.get(
'/channels',
queryParameters: {
'payload': jsonEncode({
// default options
'state': state,
'watch': watch,
'presence': presence,
// passed options
if (sort != null) 'sort': sort,
if (filter != null) 'filter_conditions': filter,
if (memberLimit != null) 'member_limit': memberLimit,
if (messageLimit != null) 'message_limit': messageLimit,
// pagination
...paginationParams.toJson(),
}),
},
);
return QueryChannelsResponse.fromJson(response.data);
}
to this
/// THIS IS THE FIXED FUNCTION
/// Line 50
/// Requests channels with a given query from the API.
Future<QueryChannelsResponse> queryChannels({
Filter? filter,
List<SortOption>? sort,
int? memberLimit,
int? messageLimit,
bool state = true,
bool watch = true,
bool presence = false,
PaginationParams paginationParams = const PaginationParams(),
}) async {
final response = await _client.post(
'/channels',
data: {
// default options
'state': state,
'watch': watch,
'presence': presence,
// passed options
if (sort != null) 'sort': sort,
if (filter != null) 'filter_conditions': filter,
if (memberLimit != null) 'member_limit': memberLimit,
if (messageLimit != null) 'message_limit': messageLimit,
// pagination
...paginationParams.toJson(),
},
);
return QueryChannelsResponse.fromJson(response.data);
}
Also I had to copy the getstream packages to my local project and add this dependency override in my pubspec.yaml
dependency_overrides:
stream_chat_flutter:
path: ./packages/stream_chat_flutter-7.1.0
stream_chat_flutter_core:
path: ./packages/stream_chat_flutter_core-7.1.0
stream_chat:
path: ./packages/stream_chat-7.1.0
In production env, Our app received wrong channels or sometimes error 403.
@AlaaAbdelbaki So we need to wait for a new release with the update ?
I'd say yes if you do not want to update the internal package yourself
Hi everyone, I am checking with the team internally to see if there were any API changes. This code block haven't been touched for over 3 years now ...
@AlaaAbdelbaki thank you for investigating. Can you please open a PR with this patch? Once I have confirmation internally from the team I will review and merge.
Today, a backend update was rolled out, resulting in the disabling of the GET request used for querying channels. This has led to an issue where all users are now able to view every conversation due to the malfunctioning of the filtering feature. To address this, please restore the GET API request as an immediate corrective action. Following that, you can initiate the planning and development of a new release update to ensure a more comprehensive solution.
@esarbanis - thanks for investigating internally.
To add some extra info.
I believe that a backend update is likely causing these issues.
Our app uses the flutter UIKit and since the early hours of this morning all our users were unable to view any channels.
This is caused by all channel querys hitting a 403 stating that 'channels cannot be returned because you don't have acces to them'.
There has been not changes to any of the code associated with stream for months - on our backend or within the app.
Edit - @esarbanis this appears to have been resolved.
It was an issue with the latest deployment of our API, this should be fixed now. Thanks everyone for their quick response and feedback 🚀
Which packages are you using?
stream_chat, stream_chat_flutter, stream_chat_flutter_core
On what platforms did you experience the issue?
iOS, Android, Web
What version are you using?
7.1.0
What happened?
Starting from today, whenever I try to query channels using a filter, the filter is always ignored, and the query function always returns the last 10 conversations.
As you can see in the screenshot, we are trying to query the channels and filtering by a field in their extra data called company ID, for this example we are trying to query all the channels that have the value "enable" for the company ID field, but the client ignores the filter and queries the latest 10 channels.
Steps to reproduce
Supporting info to reproduce
No response
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
Code of Conduct