Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

79
Views
sendbird createMyGroupChannelListQuery return empty when recall

I'm using SendBird Javascript SDK createMyGroupChannelListQuery() and the instance's next() method to retrieve the list of group channels. However, it will return the list only one time after initialized the instance, the next time it gets called, it result is always an empty array. Since I need to fetch the channels multiple times I need to have the full list of channels always. Please let me know if you have experienced this.

// Retrieve a list of channels
var listQuery = sb.GroupChannel.createMyGroupChannelListQuery();
listQuery.includeEmpty = true;
listQuery.order = 'latest_last_message'; 
listQuery.limit = 100;   // The value of pagination limit could be set up to 100.

if (listQuery.hasNext) {
    listQuery.next(function(groupChannels, error) {
        if (error) {
            // Handle error.
        }

        // A list of group channels is successfully retrieved.
        groupChannels.forEach(channel => {
            ...
        });

        ...
    });
}

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

To call it again and get the result, just call:

listQuery.hasNext = true;
about 4 years ago · Juan Pablo Isaza Report

0

I have a sandbox for you to try:

https://codesandbox.io/s/javascript-has-next-problem-fducb?file=/src/index.js

Change APP_ID and USER_ID

Check the console, it should appear "First time" and the list of channels and then "Second time" and again the list of channels.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!