python-slack-sdk icon indicating copy to clipboard operation
python-slack-sdk copied to clipboard

ActionsBlock elements are not parsed

Open healroot opened this issue 5 years ago • 3 comments

Description

In ActionsBlock init, elements are simplie copied. Exact bug place

For all other Blocks, similar elements are parsed into BlockElement How it parsed for SectionBlock How it is parsed for ContextBlock

To fix this we can deal with it the same way as in ContextBlock -> replace this line of code by self.elements = BlockElement.parse_all(elements)

Also the same issue present in current sdk version(3.1.0) Link for bug place in 3.1.0

Reproducible in:

The Slack SDK version

slackclient==2.9.3

Python runtime version

Python 3.7.0

OS info

Ubuntu 20.04.1 LTS

Steps to reproduce:

1.Copy example json from slack API docs for ActionsBlock (https://api.slack.com/reference/block-kit/blocks#actions_examples) 2.Create an ActionsBlock from parsed (to dict) json 3. Check the type of elements attribute from created ActionsBlock object

Expected result:

Elements should be instances of BlockElement, the same as it is for SectionBlock.accessory

Actual result:

Elements of ActionsBlock is not parsed

healroot avatar Dec 23 '20 12:12 healroot

@KharchenkoDmitriy Thanks a lot for taking the time to report this issue. You are right. This seems to be a long-lived bug. We will be fixing this issue early next year. If you help us fix this issue by sending a pull request (with a corresponding unit test here), that's also amazing!

seratch avatar Dec 23 '20 13:12 seratch

@seratch Thanks for fast reply. Which branch should I target for pull request? If its ok, I`m going to make a PR for both v2 and v3

healroot avatar Dec 23 '20 13:12 healroot

@KharchenkoDmitriy Sending PRs to both v3 and main (for v3) is greatly helpful!

seratch avatar Dec 23 '20 13:12 seratch