err-backend-gitter icon indicating copy to clipboard operation
err-backend-gitter copied to clipboard

Passing appropriate limit parameter for querying the users in the room

Open abhishalya opened this issue 7 years ago • 5 comments

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.

abhishalya avatar Oct 19 '18 13:10 abhishalya

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

abhishalya avatar Mar 11 '19 14:03 abhishalya

I'll make sure to open a PR by tomorrow :+1: 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.

nvzard avatar Mar 11 '19 15:03 nvzard

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

abhishalya avatar Mar 11 '19 15:03 abhishalya

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

abhishalya avatar Mar 11 '19 15:03 abhishalya

@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 avatar Mar 11 '19 16:03 nvzard