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

Initialize View state field to ViewState object based on type #1021

Closed
rei-0 opened this issue May 25, 2021 · 2 comments · Fixed by #1022
Closed

Initialize View state field to ViewState object based on type #1021

rei-0 opened this issue May 25, 2021 · 2 comments · Fixed by #1022
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 3x web-client
Milestone

Comments

@rei-0
Copy link
Contributor

rei-0 commented May 25, 2021

The View class (slack_sdk.models.views.View) does not initialize the state parameter value to ViewState(state) or ViewState(**state) based on the corresponding type (ViewState or dict, respectively)

Reproducible in:

The Slack SDK version

slack-sdk==3.5.1

Python runtime version

Python 3.8.9

OS info

ProductName:    macOS
ProductVersion: 11.3.1
BuildVersion:   20E241
Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., setup.py))

  1. Instantiate a View object with state dict value
  2. See below

Expected result:

View().state object field is ViewState type and ViewState.values is initialized with ViewStateValue objects based on state initialization parameter value

Actual result:

View().state field is dict, and ViewState and ViewStateValue objects are not initialized based on state value

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@gitwave gitwave bot added the untriaged label May 25, 2021
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 3x web-client and removed untriaged labels May 25, 2021
@seratch seratch added this to the 3.6.0 milestone May 25, 2021
@seratch
Copy link
Member

seratch commented May 25, 2021

Hi @rei-0, thanks for taking the time to report this!

As the other properties in the View class are converted to model class objects, the state also should be converted. I will come up with a pull request fixing this issue. Please feel free to join the code review if you have any feedback on the PR!

seratch added a commit to seratch/python-slack-sdk that referenced this issue May 25, 2021
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 25, 2021
@rei-0
Copy link
Contributor Author

rei-0 commented May 25, 2021

@seratch Thank you!

宜しくお願い致します〜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 3x web-client
Projects
None yet
2 participants