fix: #1884 - Fixes infinite loading issue for text/event-stream requests#4472
Conversation
Fix bug when streaming response is not ok Fix bug when clearing response of streaming request Show text signaling that the response is being streamed in the reponse status Update response size when new data is streamed in
|
@davirxavier what are your thoughts on,
@helloanoop @ramki-bruno would also love to hear your thoughts on these, how we should we approach these problems! Screen.Recording.2025-05-05.at.3.50.50.PM.mov |
|
@sanish-bruno Hello :)
|
I think we should be running the post-response scripts, after we received all the required responses and the connection is closed, that has been the behaviour on other api clients, I believe we should be following the same.
Current behaviour forces users to explicitly add @davirxavier What are your thought on these? |
|
I agree with these points, i'm currently working on adjustments for them. |
|
@sanish-bruno I have made new commits fixing the discussed problems. Below is a list of the changes i had to made in the code. Apologies for the delay.
I've managed to make a full automatic "upgrade" to streamed responses, though i've had to change all requests to the "stream" responseType. With this setting, requests will always return a stream object immediately instead of the received data for requests, even for responses that are not text/event-stream. As to not make too much changes to the current code, i've wrapped the stream in a promise, the promise will resolve with the full accumulated data when the stream closes and will reject if any error occurs. So, if the response has the text/event-stream content-type i will mark the response as a stream and return immediately (as was working before), otherwise, i will wrap the stream in the aforementioned promise and await it's completion for the full response data. For the full folder/collection runner, i have made the same changes, but the requests that have text/event-stream responses will wait for one data event and then stop automatically, so the request will not hang infinitely. I have tested these changes with text/event-stream responses, json, image, video and html and it seemed to work fine, though this will warrant more testing, as the changes i have made will affect all requests (even if the code changes are simple).
I have added a stopwatch to the response panel, it will show the elapsed time in real time. If the stream is closed it will show the full time the stream was active.
I have changed the button to not make more requests when the current request is loading. I think the same was happening to other types of requests too? So this will probably fix this for them as well.
The script will only run after the stream closes completely now. |
|
@davirxavier Thank you so much for actively working on it and we really appreciate it. I have tested it myself, and most of it seems to work as expected. we will review it. most probably will have to test the behaviour over on cli. This needs be tested thoroughly as there are many changes in major parts. we will be proactively following this. Thanks again! we will let you know if there is anything we probably need to care about. |
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
Outdated
Show resolved
Hide resolved
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
Outdated
Show resolved
Hide resolved
|
The mentioned issues have been resolved successfully. |
|
@davirxavier Thanks a lot for spending time on refining the PR. We have been looking through other API testing clients and how they handle SSE. And many of the clients support SSE as a separate entity, and have a specific UI to go with it. We are thinking of a holistic approach. Even though the PR addresses many things, we will still need to put in lot more effort to make it on par with other tools. We will be allocating time for the team to work on that. We will keep you on loop on the progress we make. We really appreciate the time you spend on this PR over the last few weeks, and the effort you put into solving each of the concerns. Thank you! |
|
Hi, any news about SSE support? is it still on the roadmap? I work with systems that use SEE and would love to see even a not-perfect solution that would just allow me to stick with Burno for all my tasks. There's been a significant amount of work put into this contribution, maybe it could be allowed for the time "the holistic solution" is being prepared? |
|
This is on our roadmap for November. @sid-bruno will be getting this merged this week. |
|
Merging it into an internal branch for fixes and improvements over the original implementation |
fc5093e
into
usebruno:feature/http-stream-internal
|
Progress can be tracked on #6074 |
|
#6074 is now merged, thanks for the contribution @davirxavier , this should be in one of the next releases |

Description
Jira
This pull request fixes the infinite loading issue when handling requests with the text/event-stream content type by adding support for these streamed request types.
I decided to implement this feature after noticing a few issues raised by users requesting it. Some mentioned that the lack of support for this content type was the only reason they hadn’t fully migrated from Postman (that's my case as well).
If i didn't follow any standards of the project or didn't add a needed change somewhere else please let me know and i will be glad to push any fixes.
Relevant issues: #1884, #2489, #498
(changed the title from feat to fix because fix seems more suited)
Changes
The code changes are really simple, in summary, i just set the responseType to stream in the axios request if the accept header is set to text/event-stream, send the incoming streamed data to the front-end by listening to the stream callbacks and treat the streamed data in the response body panel.
With these changes, if the user sends a request with an accept header of text/event-stream, the right arrow icon in the URL bar will change to an X icon and the streamed data will be concatenated to the response body panel. If the user clicks the X icon, the front-end will send an event to the back-end signaling for the stream to be closed and the data will stop being streamed.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Resolves #1884
Resolves #2489
Resolves #498