Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@macintacos
Copy link

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)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

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.

@macintacos
Copy link
Author

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.

@srajiang
Copy link
Contributor

srajiang commented Jun 14, 2024

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. 🙇‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants