Fix the issue with hanging browser tab.

This commit is contained in:
2025-12-19 02:17:08 +00:00
parent b431221f53
commit be4a7c19d0
2 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -574,8 +574,9 @@ func (s *Service) verifyStaleObservation(req staleVerifyRequest) {
func (s *Service) setupMiddleware() { func (s *Service) setupMiddleware() {
s.router.Use(middleware.Logger) s.router.Use(middleware.Logger)
s.router.Use(middleware.Recoverer) s.router.Use(middleware.Recoverer)
s.router.Use(middleware.Timeout(DefaultHTTPTimeout))
s.router.Use(middleware.RealIP) s.router.Use(middleware.RealIP)
// Note: Timeout middleware is applied per-route, not globally,
// to avoid killing SSE connections which need to stay open indefinitely
} }
// setupRoutes configures HTTP routes. // setupRoutes configures HTTP routes.
@@ -611,6 +612,7 @@ func (s *Service) setupRoutes() {
// Routes that require DB to be ready // Routes that require DB to be ready
s.router.Group(func(r chi.Router) { s.router.Group(func(r chi.Router) {
r.Use(s.requireReady) r.Use(s.requireReady)
r.Use(middleware.Timeout(DefaultHTTPTimeout))
// Session routes // Session routes
r.Post("/api/sessions/init", s.handleSessionInit) r.Post("/api/sessions/init", s.handleSessionInit)
+1 -5
View File
@@ -10,14 +10,10 @@ wording:
- fix - fix
- chore - chore
- docs - docs
- refactor
- test - test
minor: minor:
- improve
- release - release
- feat - refactor
- feature
- add
major: major:
- breaking - breaking
- major - major