rtCamp / frappe-slack-connector

Frappe app that integrates the Leave Management module with Slack
GNU Affero General Public License v3.0
3 stars 2 forks source link

Bug: Slack API throwing error for options that are more than 75 characters in length #54

Open ananyo141 opened 2 days ago

ananyo141 commented 2 days ago

Exception:

The request to the Slack API failed. (url: https://slack.com/api/views.open)
The server responded with: {'ok': False, 'error': 'invalid_arguments', 'response_metadata': {'messages': ['[ERROR] failed to match all allowed schemas [json-pointer:/view]', '[ERROR] failed to match all allowed schemas [json-pointer:/view/blocks/2/element/options/0/text]', '[ERROR] must be less than 76 characters [json-pointer:/view/blocks/2/element/options/0/text/text]']}}

This is happening while using /timesheet command for entering new timesheet.

zeel-codder commented 2 days ago

Any workaround rather than limiting the characters? If we truncate the name, it may cause issues during search. 🤔

ananyo141 commented 2 days ago

https://api.slack.com/reference/block-kit/composition-objects#option__fields The Slack Docs mention there is a hard limit of 75 chars for the text shown in the options field.

For search purposes, 75 chars might be enough for the keyword to be present.

Screenshot 2024-10-16 at 12 42 11 PM