Comments (3)
Will check that on Monday. Our DEV environment is shut down during off-hours since we should not work during these hours :)
In the meantime I did my own "circular loop breaker" logic by storing the first name that is returned and then checking after each request whether I see that name again and then just break
the loop. A bit of a duct tape and glue solution but it at least gets the job done for now.
edit:
@zimeg I tested the change now with a locally running bot using the test-workspace and it did stop after the end was reached :)
Thank you for the input and suggestion :) I still root for the conversations.lookupName
option as this would spare us from iterating through several pages of channels. Our production workspace has way fewer channels, but still somewhere around 100+ channels I guess. Our test-workspace for sure is extreme but also a good test case whether our bot will scale with an "expanding" production workspace in future :)
2nd edit:
Oh, by the way, we also have like 3500+ groups created in the meantime and here the usergroups.list
method doesn't have a pagination and therefore returns all the groups in one-go. It would by handy if there is a matching usergroups.lookupName
API method as well (maybe also a pagination approach similar to channels?)
from java-slack-sdk.
Hey @RovoMe 👋 Really appreciate the code snippet and question! Having a conversations.lookupName
method would be super useful here and I've shared this with our teams, but for now we can still tackle this with pagination.
Instead of checking for a null
cursor for the end of results when paginating, a check for the empty string will be useful for knowing when no more results are present. Could you check if this change prevents the repeated looping?
- } while (cursor != null);
+ } while (!cursor.isEmpty());
from java-slack-sdk.
@RovoMe great to hear! Just wanted to check that usergroups.list
is returning all the responses with one call and not that it's missing pagination? I'll make a note of this too if so, but am not sure if it'll be tackled with any changes around the conversations.lookupName
...
Thanks for checking the change and hope you enjoy the weekend!
from java-slack-sdk.
Related Issues (20)
- HTTP4K Duplicate Header exception HOT 3
- Field mismatch with to response. HOT 6
- A bug on the metric calculation inside async API clients
- Add slack_file object to image block / block element classes
- AsyncMethodsRateLimiter does not handle ratelimitted errors properly HOT 3
- Append `thread_ts` to the payload of a lazy listener in Slash Commands HOT 1
- Kotlin extension should be populated with an earlier api target HOT 4
- Fail to run event listeners for app_mention events with bot_message subtype HOT 1
- Slack mobile shows "Unable to show preview" despite fallback text() being present HOT 3
- AdminInviteRequestsListRequest missing an optional argument HOT 3
- Slack fails to stop metrics and OkHTTPClient threads when calling *.close() HOT 3
- `auth.test` in `MultiTeamsAuthorization` HOT 10
- Add documentation for using the `SlackSignature` verifier from `app_backend` with specific Java requirements HOT 2
- MarkdownTextObject as text in OptionObject entries for StaticSelectElements HOT 2
- Question: Is it possible to add ViewState to blockSuggestion events? HOT 5
- Request for Exact Size Limit of Timestamp (ts) Field in Java Slack SDK HOT 2
- Use the slack huddle api HOT 1
- maven distro of slack-api-client imports okhttp v4.9.3. Should be v4.12.0. HOT 2
- How to un-register/re-register a message listener HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-slack-sdk.