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

Item list pagination: url returned by the webex teams api is not complete #168

Closed
oOraph opened this issue Nov 5, 2021 · 4 comments
Closed
Milestone

Comments

@oOraph
Copy link

oOraph commented Nov 5, 2021

The sdk automatically handles the pagination for us by reusing the link: ; rel="next" header.
However the returned one can be incorrect when some parameters are specifed

The object listing can be broken or worse, can succeed while ignoring the filtering parameters for pages above the first one.

Example: a bot needs to specify mentionedPeople=me to be allowed to list room messages. If there are several pages to be returned, then the listing will fail because the mentionedPeople query parameter won't be specified when fetching the next pages

To reproduce: create a room add a bot, post more than 10 messages for the specified bot. Attempt to list messages through the webexteamssdk using the bot token

This will result in a 403 message -> can directly be manually reproduced by checking the link header in the api response (because of the missing mentionedPeople param)

The bug is actually an api bug more than an sdk one. Yet we can give a fix proposal on sdk side by reusing and amending the def _fix_next_url method in restsession.py

oOraph pushed a commit to oOraph/webexteamssdk that referenced this issue Nov 5, 2021
WebexCommunity#168

The Webex Teams api does not return all parameters when returning the next url link header. Consequently,
the object listing can be broken or worse, can succeed without returning objects expected by the provided filter.

Example: a bot needs to specify mentionedPeople=me to be allowed to list room messages. If there are several pages to be returned
then the listing will fail because the mentionedPeople query parameter won't be specified when fetching the next pages

Signed-off-by: xXraphXx <xXraphXx@users.noreply.github.com>
@oOraph
Copy link
Author

oOraph commented Nov 5, 2021

Tests not ran nor checked

gve-vse-tim pushed a commit to gve-vse-tim/webexteamssdk that referenced this issue Jan 14, 2022
@gve-vse-tim
Copy link

Can we get this merged please? This is pretty significant issue for bot use cases - the fix works for me, FWIW.

@cmlccie
Copy link
Collaborator

cmlccie commented Feb 19, 2024

This is a good idea - even as we are very late picking it up. Let me see if I can get it in the v1.7 release.

@cmlccie cmlccie added this to the v1.7 milestone Feb 19, 2024
@cmlccie
Copy link
Collaborator

cmlccie commented Mar 31, 2024

Already merged.

@cmlccie cmlccie closed this as completed Mar 31, 2024
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

3 participants