Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 18 15:46
    codecov[bot] commented #898
  • Oct 18 15:46
    julienrf synchronize #898
  • Oct 18 12:25
    codecov[bot] commented #929
  • Oct 18 12:16
    scala-steward opened #929
  • Oct 15 14:33
    codecov[bot] commented #918
  • Oct 15 14:31
    scala-steward synchronize #926
  • Oct 15 14:30
    scala-steward synchronize #918
  • Oct 15 14:30
    scala-steward synchronize #928
  • Oct 15 12:48
    julienrf commented #893
  • Oct 15 12:48
    julienrf commented #893
  • Oct 15 12:45
    julienrf closed #890
  • Oct 15 12:45
    julienrf commented #890
  • Oct 15 12:44

    julienrf on master

    Ujson: decoding floating infini… (compare)

  • Oct 15 12:44
    julienrf closed #893
  • Oct 15 12:36
    codecov[bot] commented #918
  • Oct 15 12:34
    codecov[bot] commented #928
  • Oct 15 12:27
    codecov[bot] commented #918
  • Oct 15 12:27
    scala-steward synchronize #918
  • Oct 15 12:27
    scala-steward synchronize #926
  • Oct 15 12:27
    scala-steward closed #892
Julien Richard-Foy
@julienrf
Ah, if that’s a problem we can create separate modules (e.g., http4s-streaming-server)
but I guess there is a high chance that most of the users of http4s also use the http4s-circe module?
Dominic Egger
@GrafBlutwurst
I would suspect most. I'll do some more tinkering to confirm if that's the issue
Dominic Egger
@GrafBlutwurst
hahaha I think we lazified ourselfs to death because we have an F[Stream[F,Resp]] within a Resource.use i just wrote some truly heretical code, but all tests are green. maybe someone smarter than I knows how to do this properly
Dominic Egger
@GrafBlutwurst
https://github.com/rivero-ag/endpoints4s/blob/http4s-chunked-encoding/http4s/client/src/main/scala/endpoints4s/http4s/client/ChunkedEntities.scala#L55 this is some truly cursed code but makes the tests green. If somebody has some good input on how to address this, I'd be very glad. I'm out for the day though
Dominic Egger
@GrafBlutwurst
PR is up to be looked at. It has a couple open points that I don't know how to tackle so I'd be extremely happy for some help
Julien Richard-Foy
@julienrf
@GrafBlutwurst great, I will have a look ASAP, thanks!
Dominic Egger
@GrafBlutwurst
thank you!
Julien Richard-Foy
@julienrf
@GrafBlutwurst I am not familiar with http4s but I have left a couple of comments, let me know what you think
Dominic Egger
@GrafBlutwurst
:+1: thanks!
Dominic Egger
@GrafBlutwurst
you were indeed right @julienrf the other streams need to be forced as well, it was missing tests. I'm currently adding them. Regarding the change of the Endpointsignature, how much of a problem is that gonna be for users since we're gonna break signature compatibility
Dominic Egger
@GrafBlutwurst
also changing the effect type to be Resource wrapped does work!
Julien Richard-Foy
@julienrf
I think it’s okay to introduce a breaking change in the http4s interpreters, if it brings useful features
So, which type did you change, and how, to get something that works?
Dominic Egger
@GrafBlutwurst

as you proposed I changed in http4s-client this definition

  //#endpoint-type
  type EffectResource[A] = Resource[Effect, A]
  type Endpoint[A, B] = Kleisli[EffectResource, A, B]
  //#endpoint-type

(for some reason it doesn't accept * hence the type alias indirection)

which then allowed me to no longer force streams in ChunkedEntitiesand rather consume them as intended on the tests
Julien Richard-Foy
@julienrf
Good! Do you think that type also makes sense for non-streaming requests?
Dominic Egger
@GrafBlutwurst
I think it generally makes sense, because we can't know on a level where we only have a type param Respwhether it's fine to consume the resource or not. If you depend lazily on the Response in any way shape or form you're gonna be bitten the same way
though I think you have a point that these usecases are probably pretty sparse
MR is updated
Julien Richard-Foy
@julienrf
Just an idea: instead of a type alias to Kleisli, we could define a proper type Endpoint[A, B] with a convenient operation for invoking a non-chunked endpoint:
trait Endpoint[A, B] {
  def lowLevelApply(a: A): Resource[Effect, B]
  def convenientApply(a: A): Effect[B] = ... 
}
Dominic Egger
@GrafBlutwurst
that is probably a good idea. Namingwise what do you think? perhaps .resourceand .use ?
Dominic Egger
@GrafBlutwurst
done
mhhh use might be a bad name.
Julien Richard-Foy
@julienrf
Maybe something with “consume” in it?
Not sure about “resource” as well as a name, maybe send, and sendAndConsume?
(I’m not sure when exactly the request is sent, maybe it’s not when we call these methods but later?)
Dominic Egger
@GrafBlutwurst
actually good question. I don't know if it's part of the use or the run
I adjusted it just now on the MR to send and sendAndConsume
mhh I would prefer to convey to a user that sendAndConsumeis potentially unsafe. I added a doc-comment for now
Julien Richard-Foy
@julienrf
We need to know whether use sends the request or run sends the request :)
Dominic Egger
@GrafBlutwurst
lemme do some digging
Dominic Egger
@GrafBlutwurst
So reading this (https://github.com/http4s/http4s/blob/main/blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClient.scala), and if I understand Resource correctly it has to be the effect that results from use which does allocate *> use-argument <* release essentially
with sendAndConsume just being use(effect.pure)that makes sense and is potentially dangerous depending on the type of response
the pure http4s dangerous equivalent would be client.run(req).use(IO.pure).flatMap(resp => res.stream.compile.toList) which will result in a empty stream because the underlying resource is already closed If i think this through correctly
Dominic Egger
@GrafBlutwurst
Good Morning @julienrf . I was wondering what does your regimen look like to get CI pipelines green. I saw my MR has some bin compat issues. But i was also wondering what tests you run etc. I'm probably gonna write a small readme for me because I always forget about bincompat
2 replies
Dominic Egger
@GrafBlutwurst
@julienrf we were wondering when you're planning to release the next http4s version for endpoints? We are planning to upgrade to cats3 and are a bit stuck.
Julien Richard-Foy
@julienrf
Hey, thanks for reminding me, I think nothing is blocking, I will cut it ASAP.
Julien Richard-Foy
@julienrf
I’m realizing something: endpoints4s is still on circe 0.13.0. Is it compatible with cats3?
Julien Richard-Foy
@julienrf
Thank you all for the contributions
Dominic Egger
@GrafBlutwurst
Thank you! I hope circe wasn't an issue
Dominic Egger
@GrafBlutwurst
endpoints4s/endpoints4s#874 regarding this. What do we wanna do about the Akka -> FS2 converters? currently they are ripped out from the dependency codebase since that one was hosted on bintray. I can try a source dependency through sbt
Actually I just noticed the move to Cats3 blew that up spectacularily I think we have to come up with an alternative to do the convertions
Dominic Egger
@GrafBlutwurst
regarding the chunked entities MR i see it has conflicts again, is there anything else that has to be addressed @julienrf ?
Julien Richard-Foy
@julienrf
@GrafBlutwurst I’m really sorry, I forgot that it had to be reviewed.
I will have a look soon.
Dominic Egger
@GrafBlutwurst
no worries. at your leisure, we have the changes internal right now so there's no need to hurry. We just try to upstream as much as we can
Julien Richard-Foy
@julienrf
Thank you for your patience! I just went through the diff and left some comments
Dominic Egger
@GrafBlutwurst
thanks! got a ticket for myself to upstream the changes next week. We also got a working multipart implementation for http4s which we'll hopefully upstream soon. I'll also start working on middleware support for the client algebra in a bit (specifically for us it's for logging and metrics). is that something you'd like to have as well?