slackapi / java-slack-sdk

Slack Developer Kit (including Bolt for Java) for any JVM language
https://slack.dev/java-slack-sdk/
MIT License
571 stars 212 forks source link

views.update method gives `not_found` sometimes #1220

Closed kranti-rh closed 10 months ago

kranti-rh commented 11 months ago

I'm using views.update very often. Sometimes it gives not_found which means view_id or external_id doesn't exist. But when I saw logs view_id for the view I'm gonna update is there. What else could be the reason for this issue. Any help much appreciated.

zimeg commented 11 months ago

Hi @kranti-rh! 👋 This certainly seems unexpected since you're using the view_id that appears in your logs, so I'm interested if something else might be going on.

I tried to reproduce this error myself with a race condition and calling views.update immediately after creating the modal, but didn't run into this problem. Could you share a bit more about how you're calling views.update?

kranti-rh commented 11 months ago

Hi @zimeg, Thank you for your response. Definitely, that might be something else.

My use case is to open a modal by clicking a button from a chat message. So, when the button is clicked, a BlockAction triggers. Then using the triggerId from BlockActionRequest opens( using slack.methods().viewsOpen(...) ) a loading modal as I need to do some operations before triggerId expires. Once I have my View prepared, I update( slack.methods().viewsUpdate() ) the modal.

Please let me know if you need anything else :)

seratch commented 11 months ago

This may not be your case but one possible cause would be a scenario that an end-user closes the modal before your app peforms views.update API call.

kranti-rh commented 11 months ago

@seratch I tried closing the modal and got the same error logged. So, I guess the end user is closing the modal as they think it's taking much time. There is nothing we can do about that as a developer, right?

kranti-rh commented 10 months ago

Closing this issue as it doesn't seem to be an issue that needs any action from the Slack team. Thanks!