You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CheckboxesElement within ActionsBlock silently fails to render when initial_options does not exactly match a given Option in the element's options list
#1509
Closed
1 of 9 tasks
macintacos opened this issue
Jun 14, 2024
· 2 comments
I'm building a form that gets pushed onto a modal's view. One of the blocks within that form is an ActionsBlock, and within that block is a CheckboxesElement. Up until today, this modal view was rendering just fine.
Over the course of the day today, I had updated one of the CheckboxesElement's description fields, forgetting to update the corresponding initial_options list of Options to match. I then continued about refactoring some other code in the codebase, forgetting that I had made that change.
Later on, when I went to run my application and load that form, it would just silently fail. There were no exceptions in the logs, just Slack showing in the UI "We had some trouble connecting. Try again?". After much hand-wringing and debugging, I went back to the original CheckboxesElement and realized that the Option I had updated in the options field of CheckboxesElement didn't exactly match the Option in the initial_options field of CheckboxesElement. Once I updated that, the form began rendering again.
Obviously this was my mistake, so I don't necessarily think that this is a bug. However - it would be ideal if, when trying to render the view, it would pass back some kind of validation error from the API so that I could find the issue and fix it. It took an embarrassingly long time to figure out what I did wrong, so I'd like to save others from a similar fate :)
Category (place an x in each of the [ ])
slack_sdk.web.WebClient (sync/async) (Web API client)
Or - perhaps when the View() is being serialized to be sent over the wire, it should tell me if it can't find an exact match of all initial_options in the options field. That would save y'all from updating the API, and it would make it easier to find this problem from stepping through the code.
Over the course of the day today, I had updated one of the CheckboxesElement's description fields, forgetting to update the corresponding initial_options list of Options to match. I then continued about refactoring some other code in the codebase, forgetting that I had made that change.
This has happened to me as well!
You raise an interesting suggestion @macintacos - it'd be nice if the SDK could be more helpful in this way, appreciate you writing it up and giving us your feedback! I've opened this issue to track the suggestion separately, and close this one up. 🙇♀️
I'm building a form that gets pushed onto a modal's view. One of the blocks within that form is an
ActionsBlock
, and within that block is aCheckboxesElement
. Up until today, this modal view was rendering just fine.Over the course of the day today, I had updated one of the
CheckboxesElement
'sdescription
fields, forgetting to update the correspondinginitial_options
list ofOption
s to match. I then continued about refactoring some other code in the codebase, forgetting that I had made that change.Later on, when I went to run my application and load that form, it would just silently fail. There were no exceptions in the logs, just Slack showing in the UI "We had some trouble connecting. Try again?". After much hand-wringing and debugging, I went back to the original
CheckboxesElement
and realized that theOption
I had updated in theoptions
field ofCheckboxesElement
didn't exactly match theOption
in theinitial_options
field ofCheckboxesElement
. Once I updated that, the form began rendering again.Obviously this was my mistake, so I don't necessarily think that this is a bug. However - it would be ideal if, when trying to render the view, it would pass back some kind of validation error from the API so that I could find the issue and fix it. It took an embarrassingly long time to figure out what I did wrong, so I'd like to save others from a similar fate :)
Category (place an
x
in each of the[ ]
)Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: