Closed KristianAN closed 1 day ago
It has been a long time since I touched the Slack code. It's possible a refactoring screwed this up. I agree that unsafe run is icky, but if you're interested in submitting a PR, I can merge it.
@KristianAN please see 3.15.1
release: https://github.com/outr/scribe/releases/tag/3.15.1
I can't get the slack module to work, however testing the slack hook with curl works fine for the same hash
Looking at the source in scribe I am a bit confused as to how this is supposed to work? Looking at the writer I can't see how it would actually ever write?
slack.request returns an cats.effect.IO. Meaning write returns unit not because of any unit computation but because we have a discarded non unit value. It seems to me that the options here are to either call unsafeRunAndForget or to also have an IO writer that can be wired up in the application somehow.
Creating my own SlackWriter as such
and overwriting the writer for the root logger works and it now sends messages again. Using unsafeRun is a bit icky, so having an effectful writer would be preferred, but I am guessing that might take significant work?