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

WebSocket concatenateFragmentedFrames is a no-op #3339

Open
kamilkloch opened this issue Nov 24, 2023 · 6 comments
Open

WebSocket concatenateFragmentedFrames is a no-op #3339

kamilkloch opened this issue Nov 24, 2023 · 6 comments

Comments

@kamilkloch
Copy link
Contributor

Current implementation of optionallyConcatenateFrames returns the original stream:

@adamw
Copy link
Member

adamw commented Nov 24, 2023

Do you see where the problem is? I guess it would be high time to add some tests for the pipeToBody specifically

@kamilkloch
Copy link
Contributor Author

Accumutor is always None - lines

case (Some(Left(acc)), f: WebSocketFrame.Binary) if f.finalFragment => (None, Some(f.copy(payload = acc ++ f.payload)))
through
case (Some(Right(acc)), f: WebSocketFrame.Text) if !f.finalFragment => (Some(Right(acc + f.payload)), None)
are never invoked.

@kamilkloch
Copy link
Contributor Author

Question, if such functionality is actually needed. http4s concatenates web socket frames by default, not sure about the other servers.

@adamw
Copy link
Member

adamw commented Nov 30, 2023

It is, not all servers do :) Though of course, can't tell right now which don't ;) I just remember this being the case ...

@kamilkloch
Copy link
Contributor Author

But, astonishingly, nobody is complaining about non-concatenating the frames by tapir interpreter for other servers.

@adamw
Copy link
Member

adamw commented Nov 30, 2023

Yes, maybe these are unpopular servers, or people don't send fragmented frames that often. I don't know really :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants