slackapi / bolt-python

A framework to build Slack apps using Python
https://slack.dev/bolt-python/
MIT License
1.05k stars 245 forks source link

How to send data for external_select where it takes more time to fetch the data? #1083

Closed tikluganguly closed 2 months ago

tikluganguly commented 4 months ago

Hi All,

I have a function like the following

def sent_list_options(ack:Ack,options:Optional[Dict[str, Any]],logger:log.Logger): query=options.get('value') ack(mod.get_search_option_by_query(query))

I could see the function executing properly and getting the option list. But it takes close to 3-4 seconds to get the options. and by that time, I see an option not found in the external_select. Generally, this issue can be handled if we call an ack at the beginning of the function. But here I cannot use ack as using that will always give me a blank option list. Please suggest what can I do to display options where the options take more time to generate

Thanks Tiklu

zimeg commented 4 months ago

Hey @tikluganguly! 👋 From what I can tell, the acknowledgement response with options has to happen within 3 seconds and only the first acknowledgment can provide updated options. This might cause the "option not found" message you're finding with external_select and I'm not sure of a workaround to avoid this right away...

This might not be the best suggestion, but is it possible to speed up the response that returns options? I understand a lot of querying might happen behind the scenes, but if any of that work can be offloaded it could be useful 🤔

I also experimented with a quick example of sending a double acknowledgment with options, but without much luck: https://github.com/zimeg/slacks/tree/cli.boltpy.modal

tikluganguly commented 4 months ago

Actually it is not possible to speed up the response as of now. That is why I was hoping if there is an option to send a ack and then if there is any other option to send the response.

tikluganguly commented 4 months ago

I liked the sample that you shared. Let me try it and I will get back to you with the response

github-actions[bot] commented 3 months ago

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

github-actions[bot] commented 2 months ago

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.