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

Passing appropriate limit parameter for querying the users in the room #38

Open
abhishalya opened this issue Oct 19, 2018 · 5 comments
Open

Comments

@abhishalya
Copy link
Contributor

In the following code:

json_users = self._backend.readAPIRequest('rooms/%s/users' % self._idd)

The limit parameter is not passed which defaults to 30. Hence every time it will only return a list of 30 users but since we need a list of all users a suitable value of limit must be passed to the request.

nvzard added a commit to nvzard/err-backend-gitter that referenced this issue Oct 28, 2018
The limit parameter was not used which defaults to 30
and fails to return all the members in the room.

Closes errbotio#38
@abhishalya
Copy link
Contributor Author

@nvzard This seems to be important since we already depend upon the member list. This seems to be more like a needs design issue.

@nvzard
Copy link
Contributor

nvzard commented Mar 11, 2019

I'll make sure to open a PR by tomorrow 👍
Also maybe we'll have to take some advice from the guys in errbot room.
Since gitter API only responds with 100 members at a time. We'd most probably have to make ceil(total_members/100) requests skipping 100 members with every request to get a list of the members in the room.

@abhishalya
Copy link
Contributor Author

abhishalya commented Mar 11, 2019

@nvzard Took help from the gitter guys, see this. But yeah the concept is same.

@abhishalya
Copy link
Contributor Author

Also I guess one more important thing would be, we should be able to store the list and update it as required since I think we shouldn't make calls for every command (where we need this).

@nvzard
Copy link
Contributor

nvzard commented Mar 11, 2019

@abhishalya Even I took there help a long time ago https://gitter.im/gitterHQ/gitter?at=5bd7328082893a2f3b5c0cc5

Yeah! I'll look into this :)

we should be able to store the list and update it as required since I think we shouldn't make calls for every command

nvzard added a commit to nvzard/err-backend-gitter that referenced this issue Mar 12, 2019
The limit parameter was not used which defaults to 30
and returns maximum 100 users at a time. Hence, it fails
to return all the members in the room.
In order to tackle this, we need to iterate by skipping
100 members with every API request. Also users count
needs to be updated everytime list of occupants is
requested as new users may join a room in realtime.

Closes errbotio#38
nvzard added a commit to nvzard/err-backend-gitter that referenced this issue Mar 12, 2019
The limit parameter was not used which defaults to 30
and returns maximum 100 users at a time. Hence, it fails
to return all the members in the room.
In order to tackle this, we need to iterate by skipping
100 members with every API request. Also users count
needs to be updated everytime list of occupants is
requested as new users may join a room in realtime.

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

No branches or pull requests

2 participants