Code Monkey home page Code Monkey logo

Comments (9)

esarbanis avatar esarbanis commented on May 30, 2024 2

It was an issue with the latest deployment of our API, this should be fixed now. Thanks everyone for their quick response and feedback 🚀

from stream-chat-flutter.

esarbanis avatar esarbanis commented on May 30, 2024 1

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.

from stream-chat-flutter.

tahaJemmali avatar tahaJemmali commented on May 30, 2024 1

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.

from stream-chat-flutter.

senkia24 avatar senkia24 commented on May 30, 2024

same here any update?

from stream-chat-flutter.

AlaaAbdelbaki avatar AlaaAbdelbaki commented on May 30, 2024

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

from stream-chat-flutter.

senkia24 avatar senkia24 commented on May 30, 2024

In production env, Our app received wrong channels or sometimes error 403.

from stream-chat-flutter.

nbourdin avatar nbourdin commented on May 30, 2024

@AlaaAbdelbaki So we need to wait for a new release with the update ?

from stream-chat-flutter.

AlaaAbdelbaki avatar AlaaAbdelbaki commented on May 30, 2024

I'd say yes if you do not want to update the internal package yourself

from stream-chat-flutter.

nullpoint-dev avatar nullpoint-dev commented on May 30, 2024

@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.

from stream-chat-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.