question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Value property in an Option limited to 75 chars in its model class

See original GitHub issue

The documentation states the value field of the option can accepted values up to 2000 chars in length. When creating an Option object with a value of 76 chars it throws an exception.

slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters

Reproducible in:

from slack_bolt import App
from slack_sdk.models.blocks import ActionsBlock
from slack_sdk.models.blocks.block_elements import Option, StaticSelectElement

options = [
        Option(label="Sample Label", value="x" * 76),
    ]
select_drop = StaticSelectElement(
    placeholder="Select Something", action_id="select", options=options
)

action_block = ActionsBlock(
    elements=[select_drop],
    block_id="action_block",
)

app = App()
response = app.client.chat_postMessage(
    channel="my_channel",
    blocks=[action_block],
    text="Message with dropdown"
)
pass

The Slack SDK version

slack-bolt==1.7.0 slack-sdk==3.8.0

Python runtime version

Python 3.9.5

OS info

ProductName: macOS ProductVersion: 11.4 BuildVersion: 20F71 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64

Steps to reproduce:

Run python snippet above

Expected result:

Successful posting as the char length of value of 76 is less than the documentation stated limit of 2000

Actual result:

Exception indicating the char length limit of value is 75 chars

slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
seratchcommented, Aug 18, 2021

Let us close this issue now but please feel free to write in whenever you have anything further to ask/discuss here!

0reactions
seratchcommented, Aug 13, 2021

Hi @andrewhharmon, thanks for taking the time to write in here!

As you’ve already noticed yourself, the maximum value of value property is 75 while value in interactive components like buttons can have 2K characters. Thus, the current implementation of the validation should be valid.

Regarding the pattern using dict values instead of model class objects, the SDK side value validation does not work for the dict data. Thus, it is also an expected behavior.

If everything is clear now, would you mind closing this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Value property in an Option limited to 75 chars in its model class
Value property in an Option limited to 75 chars in its model class. ... states the value field of the option can accepted...
Read more >
Setting a max character length in CSS - html - Stack Overflow
An example with truncation on 3 rows. You could see what space occur 75 characters according to your typography and set a max-width...
Read more >
max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >
A quick tour of attribute domains—ArcMap | Documentation
Using domains helps ensure data integrity by limiting the choice of values for a particular field. Attribute domains can be shared across feature...
Read more >
Visualization: Column Chart - Google Developers
Overview. A column chart is a vertical bar chart rendered in the browser using SVG or VML, whichever is appropriate for the user's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found