Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] queryChannels with members.$eq for a user with a lot of chats causes a timeout. #2694

Open
2 of 8 tasks
pfcodes opened this issue Sep 27, 2024 · 1 comment
Open
2 of 8 tasks

Comments

@pfcodes
Copy link

pfcodes commented Sep 27, 2024

Issue

One of our users is a member in over 2,000 channels. The following snippet will cause a timeout.

const channels = await client.queryChannels({
  type: channelType,
  members: { $eq: [currentUserData.uuid, data.uuid] },
})

Steps to reproduce

Steps to reproduce the behavior:

  1. Have user with high number of channel memberships (2000+).
  2. Run client.queryChannels with only type and members.eq
  3. Observe timeout error

Expected behavior

The chat should not timeout.

Project Related Information

Customization

Click To Expand

# N/A

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Click To Expand

package.json:

"stream-chat-expo": "5.33.1"

react-native info output:

System:
  OS: macOS 15.0
  CPU: (12) arm64 Apple M2 Pro
  Memory: 102.30 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: /var/folders/q4/5l11j4gj5f3gc0pd1yzb06wm0000gn/T/yarn--1727421488330-0.12896531729900418/node
  Yarn:
    version: 1.22.22
    path: /var/folders/q4/5l11j4gj5f3gc0pd1yzb06wm0000gn/T/yarn--1727421488330-0.12896531729900418/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 2023.01.09.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.11.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:
    • 5.33.1
  • Device/Emulator info:
    • I am using a physical device
    • OS version: 18.0
    • Device/Emulator: iPhone 15 Pro

Additional context

Might have to create another issue for this, but another strange bug we have is that setting a timeout doesn't work.

const chatClient = StreamChat.getInstance(
  Constants.expoConfig?.extra?.streamApiKey,
  { timeout: 60000 },
)

The following console log will print 3000

console.log(chatClient.options.timeout)

Screenshots

Click To Expand


@pfcodes pfcodes closed this as completed Sep 27, 2024
@pfcodes pfcodes reopened this Nov 14, 2024
@pfcodes pfcodes changed the title [🐛] queryChannels with only type and members for a user with a lot of chats causes a timeout. [🐛] queryChannels for a user with a lot of chats causes a timeout. Nov 14, 2024
@pfcodes pfcodes changed the title [🐛] queryChannels for a user with a lot of chats causes a timeout. [🐛] queryChannels with members.$eq for a user with a lot of chats causes a timeout. Nov 14, 2024
@khushal87
Copy link
Member

Can you share with us your app id, and the user so that we can test this on our side?

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

No branches or pull requests

2 participants