Closed kranti-rh closed 10 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
?
views.update
happening immediately or after some delay?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.
BlockActionRequest
. For modal open and update using Slack API like this:
static final Slack slack = new Slack();
.
.
.
// open modal
ViewsOpenResponse response = slack.methods().viewsOpen(r -> r
.token(botToken)
.triggerId(triggerId)
.view(view));
.
.
.
// update modal
ViewsUpdateResponse updateResponse = slack.methods().viewsUpdate(r -> r
.token(botToken)
.viewId(previousView.getId())
.hash(previousView.getHash())
.view(view)
Does this matter using Bolt or Slack API Client?
Please let me know if you need anything else :)
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.
@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?
Closing this issue as it doesn't seem to be an issue that needs any action from the Slack team. Thanks!
I'm using views.update very often. Sometimes it gives
not_found
which meansview_id
orexternal_id
doesn't exist. But when I saw logsview_id
for the view I'm gonna update is there. What else could be the reason for this issue. Any help much appreciated.