slackapi / slack-api-specs

Open API specifications for platform products by Slack
MIT License
221 stars 64 forks source link

`duplicate_external_id` unavoidable if modal not explicitly closed #52

Open tybro0103 opened 3 years ago

tybro0103 commented 3 years ago

Description

Receiving duplicate_external_id error from views.open endpoint when the modal was previously open and then closed by any means other than explicitly clicking the close or submit buttons.

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Reproducible in:

production

Steps to reproduce:

  1. Use views.open to open a modal with external_id: 'foo'.
  2. Press CMD+R in Slack app to reload.
  3. -the modal will now be gone-
  4. Try to open the same modal with same external_id: 'foo' again.

Expected result:

The modal should open again.

Actual result:

The modal does not open, and I get the duplicate_external_id error code.

Attachments:

https://youtu.be/ITAyKDSFg0w

swippy commented 2 years ago

I have similar issues as mentioned above, but this is how it happened.

I happened all the time. I have to modify my script to avoid of using this external_id parameter to solve the case. I believe if there is no issue with this external_id, this external_id usage would benefit to my script without having ugly workaround solution.

Please solve this issue.

xdesign-ricardobarata commented 1 year ago

Just giving this one a bump! Seems like it has been opened for quite a while. In the meantime I'll have to find a work around too :D

xdesign-ricardobarata commented 1 year ago

For my particular use case I found that I could replace

await client.views.update({
      external_id: <external_id>
      trigger_id: body.trigger_id,
      view: <updated_view>
    });

by

await client.views.update({
      view_id: body.view.id,
      trigger_id: body.trigger_id,
      view: <updated_view>
    });

all this comes wrapped in

export const <nameoftheCallback>: Middleware<
  SlackActionMiddlewareArgs<BlockAction>
> = async ({ body, ack, client }) => {

Feels a bit slower (maybe just on my eyes), but at least is not giving me any issues