Closed bphenriques closed 10 months ago
Hi @bphenriques, thanks for asking the questions!
Do you have guidelines for teams that are using Scala + http4s? It is the recommended http server stack within the typelevel ecosystem?
We currently do not have such guidelines. However, if you lean towards leveraging the typelevel ecosystem along with http4s for Slack app development, Bolt does not prevent you from doing so.
If not, perhaps it would be best delegating the decoding of the body to the SDK: What do you recommend?
Yes, we highly recommend allowing Bolt to parse the request body data, instead of doing it on your http4s code side. This is essential not only for saving your time but also for performing a valid request verification within the Bolt framework. In essence, the key points you should take note of are:
Keeping the above considerations in mind, the implementation of the adapter which bridges your http4s server code with Bolt's App instance should not be a time-consuming task (given your familiarity with http4s). As you may have discovered, there are numerous reliable code examples showcasing how to accomplish this. Examples like bolt-servlet, bolt-ktor, bolt-http4k, bot-aws-lambda, and many more can be found in this repository.
Will the proposed API remain public? Concerned that there might a breaking change making that API protected/private.
No, they certainly won't. Bolt is utilized by numerous enterprise customers and partners. We will definitely ensure the interface's stability.
I hope this clarifies your concern! Please note, however, that nobody in my team possesses familiarity with http4s and typelevel libraries. Therefore, we may not be of assistance for Scala-specific inquiries.
Thank you for the swift and complete response!
No, they certainly won't. Bolt is utilized by numerous enterprise customers and partners. We will definitely ensure the interface's stability.
Thank you!
Keeping the above considerations in mind, the implementation of the adapter which bridges your http4s server code with Bolt's App instance should not be a time-consuming task (given your familiarity with http4s
Following the conversation, I managed to re-use the abstractions you have and bridge between responses/requests between http4s and the slack library. It was smooth, so thank you for building exposing these building blocks! 👍
Overall:
com.slack.api.bolt.util.SlackRequestParser
and then handle the SlackRequest
accordingly.ack
family Slack's HTTP responses to a http4s responses (http code, body and content-type). However, I am finding some trouble as modals only show "We had some trouble connecting. Try again?" with no more information - e.g., answering a view_submission
with a ackWithUpdate
with the same view with a new input-block. This is a separate question and it seems to be common theme. I will check again and if I keep having problems I will reach out in a different thread.I hope this clarifies your concern! Please note, however, that nobody in my team possesses familiarity with http4s and typelevel libraries. Therefore, we may not be of assistance for Scala-specific inquiries.
That is alright 👍 If useful, I may share some of my findings in this thread.
Thanks again for posting this question! Let me close this issue for now, but whenever you have any comments, please feel to write in!
[Question]
Hello,
Our team is investigating how to extend an existing http4s server to receive webhooks from Slack. Things are getting murkier as we need do some of the wiring ourselves and bridge with the Typelevel stack:
IO.fromCompletableFuture(IO(client.viewsOpen(request)))
Questions:
http4s
? It is the recommended http server stack within the typelevel ecosystemThank you!
Edit: this code-example I found in another ticket might be a good starting point: https://github.com/seratch/bolt-dropwizard-app/blob/main/src/main/java/example/SlackBoltApplication.java