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

Displaying errors in views over socket mode is unclear or broken #1013

Open
afilbert opened this issue Dec 29, 2021 · 2 comments
Open

Displaying errors in views over socket mode is unclear or broken #1013

afilbert opened this issue Dec 29, 2021 · 2 comments

Comments

@afilbert
Copy link

afilbert commented Dec 29, 2021

What happened

Calling Ack with a payload on modal view submission behaves unexpectedly.

Expected behavior

Displaying errors in views should highlight the appropriate block/field.

Steps to reproduce

  1. Handle a view_submission interaction.
  2. Pass the errors response action as payload.
  3. Observe that modal displays a generic "trouble connecting" error.

Screen Shot 2021-12-28 at 11 00 08 PM

code

case slack.InteractionTypeViewSubmission:
	result := d.handleFormSubmission(interaction)
	if (FormError{}) != result {
		payload := slack.NewErrorsViewSubmissionResponse(map[string]string{
			result.Key: result.Message,
		})
		d.socketService.Ack(*event.Request, payload)
		return
	}

manifest.yaml

_metadata:
  major_version: 1
  minor_version: 1
display_information:
  name: Mentor Match - dev
features:
  app_home:
    home_tab_enabled: false
    messages_tab_enabled: true
    messages_tab_read_only_enabled: false
  bot_user:
    display_name: Mentor Match
    always_online: true
  slash_commands:
    - command: /mentor-match
      description: Start Mentor Matching
      should_escape: false
    - command: /mentor-stop
      description: Stop Mentor Matching
      should_escape: false
oauth_config:
  scopes:
    bot:
      - app_mentions:read
      - channels:read
      - chat:write
      - chat:write.customize
      - commands
      - conversations.connect:read
      - conversations.connect:write
      - incoming-webhook
      - users.profile:read
      - users:read
      - users:read.email
      - users:write
      - im:write
settings:
  event_subscriptions:
    bot_events:
      - app_mention
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

Versions

  • Go: 1.17.3
  • slack-go/slack: v0.9.5
@gtabrar
Copy link

gtabrar commented Sep 12, 2022

Hitting this same issue now. Did you find a solution @afilbert?

@gtabrar
Copy link

gtabrar commented Sep 12, 2022

Okay, I figured this out. Hopefully this will help someone out who ends up here;

You can only reference the BlockID for an InputBlock. In my case, I had a SelectBlockElement with a list of channels inside a SectionBlock, which worked flawlessly up until I hit this issue of trying to validate the input.

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