slackapi / java-slack-sdk

Slack Developer Kit (including Bolt for Java) for any JVM language
https://slack.dev/java-slack-sdk/
MIT License
570 stars 209 forks source link

Slack mobile shows "Unable to show preview" despite fallback text() being present #1282

Closed daniel-b2c2 closed 4 months ago

daniel-b2c2 commented 6 months ago

I have specified fallback text via the .text() method, yet the text displayed in the Activity section for my bot's post shows 'Unable to show preview. Tap to see the original message' I would expect this for rich text with a missing fallback, but not when the fallback is specified.

Reproducible in: None

mvn dependency:tree | grep com.slack.api
gradle dependencies | grep com.slack.api
java -version
sw_vers && uname -v # or `ver`

The Slack SDK version

(Paste the output of mvn dependency:tree | grep com.slack.api or gradle dependencies | grep com.slack.api) 1.38.1

Java Runtime version

(Paste the output of java -version)

openjdk version "11.0.20.1" 2023-08-24 OpenJDK Runtime Environment Homebrew (build 11.0.20.1+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.20.1+0, mixed mode)

OS info

(Paste the output of sw_vers && uname -v on macOS/Linux or ver on Windows OS) ProductName: macOS ProductVersion: 14.3 BuildVersion: 23D56

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., pom.xml/build.gradle))

var blocks = ...; //blocks is some complex rich text arrangement. doesn't really matter what the arrangement is.
return ChatPostMessageRequest.builder().text("Ancient Version Report: 2 items reported.").blocks(blocks).build();

Expected result:

As a slack mobile user, on the Activity panel, selecting All (where the above text results in a keyword notification for me) to show the fallback text "Ancient Version Report: 2 items reported'"

Actual result:

On the slack mobile app, on the Activity panel, an entry is displayed, but the text is summarised as "Unable to show preview. Tap to see the original message". I would expect this to happen if I had not provided the fallback text, but the .text() method suggests that I have.

IMG_2359

Requirements

Please make sure if this topic is specific to this SDK. 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. :bow:

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

seratch commented 6 months ago

Hi @daniel-b2c2, thanks for posting the question, and we're sorry for overlooking this for two weeks.

I quickly tried to reproduce this issue on my end, but I haven't managed to see the same yet. If you could share an exact way to reproduce it (e.g., code snipeet, Block Kit JSON data), I may be able to check it out. With the given information so far, I don't think this could happen with normal use cases, so your situation might be a kind of an edge case. If you're using the rich text blocks in an unsual way, the iOS/Android app may not be able to recognize it correcty. Revising your Block Kit inputs would be worth trying.

Also, it seems that this is not an issue specific to Java SDK, so if you're fine with communicate with our customer support team only using Block Kit JSON data (meaning no Java code snippet), they can help you out too in a more timely manner.

I hope this helps.

github-actions[bot] commented 5 months ago

👋 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.

github-actions[bot] commented 4 months ago

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.