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

Static Select have a random initial value on iOS Slack App slack bolt python #1171

Open
Artpel1805 opened this issue Sep 30, 2024 · 3 comments
Assignees
Labels
auto-triage-stale question Further information is requested server-side Server-sider issue with the Slack Platform or Slack API

Comments

@Artpel1805
Copy link

Artpel1805 commented Sep 30, 2024

Hi everyone ! :)

I'm new to Slack app development. I am currently using Slack Bolt SDK for python.I have created a simple static select with 5 options :

class SectionStaticSelect(SectionBlock):
    def __init__(self):

        options_list : List[Option] = []
        for i in range(5):
            options_list.append(
                Option( 
                        value=f"select_option_{i}",
                        text= f"option{i}"
                    )
            )

        super().__init__(
            text=TextObject(
                type="mrkdwn",
                text="section"
            accessory=StaticSelectElement(
                action_id="select_option",
                options=options_list,
                placeholder="choose an option"
            ),
        )

This static select trigger my HomePage().push() function that simply trigger a new home page to the user client.
Here is the class HomePage :

class HomePage:
    def __init__(self, *, client: WebClient, user_id: str):
        self.client = client
        self.user_id = user_id

    def push(self, view: View) -> SlackResponse:
        return self.client.views_publish(user_id=self.user_id, view=MainScreen())
class MainScreen(View):
    def __init__(
        self,
    ):
        blocks = [
           SectionStaticSelect()
        ]

        super().__init__(type="home", callback_id="home_view", blocks=blocks)

On desktop the app have the perfect expected behavior but on iOS, even if i haven't inputed any initial_option , the StaticSelect Slack Bolt element seems to take a random initial_value.

  • I tried to print the value return by the HomePage().push() and the printed value is the expected behavior and do not represent what is displayed on iOS

  • I expect the StaticSelect element to not have any initial_option as on desktop

The slack_bolt version

slack_bolt 1.19.1
slack_sdk 3.31.0

Python runtime version

Python
3.12.1

OS info

ProductName: macOS
ProductVersion: 14.2
BuildVersion: 23C64
Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112

iOS Version

Tested on Iphone 13 Pro Max 17.5.1
Slack App version 24.08.40 (443050)

Steps to reproduce:

  1. Experience the bug with SlackRequestHandler() for FastAPI
@hello-ashleyintech hello-ashleyintech self-assigned this Sep 30, 2024
@hello-ashleyintech
Copy link

Hi, @Artpel1805! Thanks for submitting. Going to see if I can repro this - at initial read, it seems like this might be a device-related issue, so we may need to end up forwarding it to another channel if it is determined to be that.

Also while I try to repro, quick follow up q - for the initial_value that ends up surfacing on iOS, are you noticing any patterns? Is it just pulling a random value from the list? Is it pulling in a certain order?

@Artpel1805
Copy link
Author

Artpel1805 commented Sep 30, 2024

Hello @hello-ashleyintech thanks for quick response and your advices !
I think i have figure out what is happening.

The first time i visit a view everything works well. But when i visit a second time the view - the initial value is the value of the Option i have choosen when i was on this View.

For example : I'm on View 1 for the first time (No initial Option), I visit View 4 (No initial Option), and go back to view 1 then Static Select indicates Option 4. And if i go to View 4 Static Select indicates Option 1

So it's seems i'm only retrieving a previous or a cached View instead of pushing a new one.

@seratch seratch added server-side Server-sider issue with the Slack Platform or Slack API question Further information is requested labels Oct 1, 2024
Copy link

github-actions bot commented Nov 4, 2024

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-stale question Further information is requested server-side Server-sider issue with the Slack Platform or Slack API
Projects
None yet
Development

No branches or pull requests

3 participants