flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Backend] Send periodic SSE keep-alive comment frames to prevent reverse-proxy idle timeouts

Open blurbeast opened this issue 1 month ago • 14 comments

Overview

In backend/src/services/sse.service.ts and backend/src/controllers/sse.controller.ts, open Server-Sent Events connections remain silent when no on-chain stream events occur.

Problem

  • Load balancers and reverse proxies (Nginx, Cloudflare, AWS ALB) drop idle HTTP connections after 60 seconds of inactivity if no bytes are sent.

Proposed Changes

  1. Set up a 25-second interval timer in sse.service.ts that writes an SSE comment frame (: keepalive <timestamp>\n\n) to all connected clients.
  2. Clear the timer cleanly when the service shuts down or when the last client disconnects.

Acceptance Criteria

  • [ ] Connected SSE clients receive a : keepalive comment frame every 25 seconds.
  • [ ] Disconnected clients are pruned if writing the heartbeat fails.
  • [ ] Unit test added using fake timers to verify heartbeat emission and cleanup.

blurbeast avatar Oct 18 '26 05:10 blurbeast

@TekenujUi90 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

I’ve reviewed the issue from both the requirements and implementation perspective. I’d like to take ownership of it and deliver a solution that is robust, testable, and appropriately scoped to the problem.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @TekenujUi90 to this issue.

TekenujUi90 avatar Oct 18 '26 14:10 TekenujUi90

@Johnsource-hub has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Please Maintainer, assign this issue to me. Thank you so much

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Johnsource-hub to this issue.

Johnsource-hub avatar Oct 18 '26 14:10 Johnsource-hub

@ezej0687-creator has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi Maintainer,

I have gone through this project and I noticed that it's something I can do. Please can you assign this project to me.

Thank you!

ℹ️ Repo Maintainers: To accept this application, review their application or assign @ezej0687-creator to this issue.

ezej0687-creator avatar Oct 18 '26 14:10 ezej0687-creator

@DeeMyth has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Good day maintainer I have gone through the requirement of this issue and I can definitely solve it Please assign it to me

ℹ️ Repo Maintainers: To accept this application, review their application or assign @DeeMyth to this issue.

DeeMyth avatar Oct 18 '26 14:10 DeeMyth

@MrOmale has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi Maintainer, I would love to work on this issue please.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @MrOmale to this issue.

MrOmale avatar Oct 18 '26 14:10 MrOmale

@innocentharuna has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hey maintainer, please kindly assign this to me, i can surely fix it

ℹ️ Repo Maintainers: To accept this application, review their application or assign @innocentharuna to this issue.

innocentharuna avatar Oct 18 '26 14:10 innocentharuna

@harmondconsultant-png has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hy, i can work on it pleas assign

ℹ️ Repo Maintainers: To accept this application, review their application or assign @harmondconsultant-png to this issue.

harmondconsultant-png avatar Oct 18 '26 14:10 harmondconsultant-png

@DooseWayo has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Can I work on this task?

ℹ️ Repo Maintainers: To accept this application, review their application or assign @DooseWayo to this issue.

DooseWayo avatar Oct 18 '26 14:10 DooseWayo

@Wittig18 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hey maintainer, i would love to work on this

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Wittig18 to this issue.

Wittig18 avatar Oct 18 '26 14:10 Wittig18

@Yilkash has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Can i work on this?

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Yilkash to this issue.

Yilkash avatar Oct 18 '26 14:10 Yilkash

@VeronicDev has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello Maintainer, I can fix this please assign.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @VeronicDev to this issue.

VeronicDev avatar Oct 18 '26 14:10 VeronicDev

Congratulations, @DooseWayo! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

🧑‍💻 @DooseWayo: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Oct 18 '26 14:10 drips-wave[bot]

This issue has been completed by @DooseWayo as part of the Stellar Wave Program's 10th Wave 🥳

😎 @DooseWayo: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Oct 18 '26 16:10 drips-wave[bot]