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

sse: Close connection before page switch #147

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

srid
Copy link

@srid srid commented Feb 20, 2025

Description

This PR may require changes before needing merge. All it does is unconditionally close the SSE connections before the page is about to be switched. The problem is that - on Chrome (but not Safari) if we do not do this, then the SSE connections are kept alive and for every page/route switch, there will be O(n) active SSE connections, which from time to time causes normal link clicks to hang (DevTools shows that request in pending mode) for sometime before the server responds (using Haskell servant here).

Htmx version: https://unpkg.com/[email protected]
Used extension(s) version(s): sse from master

Corresponding issue: bigskysoftware/htmx#2109

I'll leave this as draft just to indicate that a) it is not ready to be merged, b) provide a fork for other interested party to rely upon, and c) maybe inspire somebody else to finish it.

Testing

Checklist

  • I have read the contribution guidelines
  • I ran the test suite locally (npm run test) and verified that it succeeded

Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for htmx-extensions canceled.

Name Link
🔨 Latest commit 0f7b0b5
🔍 Latest deploy log https://app.netlify.com/sites/htmx-extensions/deploys/67b741e68395660008ff2087

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

Successfully merging this pull request may close these issues.

1 participant