Skip to content

Commit 148fe43

Browse files
anti-duhringclaude
andauthored
feat(graphql): add SSE transport with extended write deadline (#119)
* feat(graphql): add SSE transport with extended write deadline Wrap gqlgen's SSE transport to extend the per-connection write deadline, preventing the default server WriteTimeout from killing long-running streams (e.g. LLM token-by-token responses). Switch to explicit transport registration via handler.New and bump gqlgen + Go module deps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(graphql): log SetWriteDeadline error and add SSE transport tests Clarify in the doc comment that the deadline is absolute (raises the ceiling, not unbounded streaming). Surface SetWriteDeadline failures via a warn log so a misconfigured ResponseWriter doesn't silently fall back to the server's WriteTimeout. Add unit tests covering Supports and the deadline being applied (default + custom). --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7ad724d commit 148fe43

5 files changed

Lines changed: 214 additions & 61 deletions

File tree

go.mod

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
module github.com/gothunder/thunder
22

3-
go 1.21
4-
5-
toolchain go1.21.6
3+
go 1.25
64

75
require (
86
entgo.io/ent v0.12.5
9-
github.com/99designs/gqlgen v0.17.43
7+
github.com/99designs/gqlgen v0.17.87
108
github.com/TheRafaBonin/roxy v0.7.0
119
github.com/ThreeDotsLabs/watermill v1.3.5
1210
github.com/cenkalti/backoff/v4 v4.2.1
1311
github.com/go-chi/chi/v5 v5.0.10
14-
github.com/google/uuid v1.5.0
12+
github.com/google/uuid v1.6.0
1513
github.com/mattn/go-sqlite3 v1.14.16
1614
github.com/onsi/ginkgo/v2 v2.12.1
1715
github.com/onsi/gomega v1.27.10
1816
github.com/rabbitmq/amqp091-go v1.8.1
1917
github.com/rotisserie/eris v0.5.4
2018
github.com/rs/zerolog v1.31.0
2119
github.com/streadway/amqp v1.0.0
22-
github.com/stretchr/testify v1.8.4
23-
github.com/vektah/gqlparser/v2 v2.5.11
20+
github.com/stretchr/testify v1.11.1
21+
github.com/vektah/gqlparser/v2 v2.5.32
2422
github.com/vektra/mockery/v2 v2.33.3
2523
github.com/vmihailenco/msgpack/v5 v5.3.5
2624
go.opentelemetry.io/otel v1.22.0
@@ -37,10 +35,11 @@ require (
3735
github.com/felixge/httpsnoop v1.0.3 // indirect
3836
github.com/go-logr/stdr v1.2.2 // indirect
3937
github.com/go-openapi/inflect v0.19.0 // indirect
38+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
4039
github.com/golang/protobuf v1.5.3 // indirect
4140
github.com/hashicorp/errwrap v1.1.0 // indirect
4241
github.com/hashicorp/go-multierror v1.1.1 // indirect
43-
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
42+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
4443
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
4544
github.com/iancoleman/strcase v0.2.0 // indirect
4645
github.com/jinzhu/copier v0.3.5 // indirect
@@ -49,31 +48,32 @@ require (
4948
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
5049
github.com/oklog/ulid v1.3.1 // indirect
5150
github.com/rogpeppe/go-internal v1.12.0 // indirect
52-
github.com/sosodev/duration v1.2.0 // indirect
51+
github.com/sosodev/duration v1.3.1 // indirect
5352
github.com/zclconf/go-cty v1.13.2 // indirect
5453
go.opentelemetry.io/contrib v1.21.1 // indirect
5554
go.uber.org/goleak v1.3.0 // indirect
5655
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
56+
golang.org/x/sync v0.19.0 // indirect
5757
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
58-
google.golang.org/protobuf v1.32.0 // indirect
58+
google.golang.org/protobuf v1.36.11 // indirect
5959
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
6060
)
6161

6262
require (
6363
github.com/ThreeDotsLabs/watermill-amqp v1.1.4
64-
github.com/agnivade/levenshtein v1.1.1 // indirect
64+
github.com/agnivade/levenshtein v1.2.1 // indirect
6565
github.com/alexdrl/zerowater v0.0.3
6666
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6767
github.com/fsnotify/fsnotify v1.6.0 // indirect
6868
github.com/go-logr/logr v1.4.1 // indirect
6969
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
70-
github.com/google/go-cmp v0.6.0 // indirect
70+
github.com/google/go-cmp v0.7.0 // indirect
7171
github.com/google/pprof v0.0.0-20220608213341-c488b8fa1db3 // indirect
7272
github.com/gorilla/websocket v1.5.0 // indirect
7373
github.com/hashicorp/hcl v1.0.0 // indirect
7474
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7575
github.com/magiconair/properties v1.8.7 // indirect
76-
github.com/mattn/go-colorable v0.1.13 // indirect
76+
github.com/mattn/go-colorable v0.1.14 // indirect
7777
github.com/mattn/go-isatty v0.0.20 // indirect
7878
github.com/mitchellh/go-homedir v1.1.0 // indirect
7979
github.com/mitchellh/mapstructure v1.5.0 // indirect
@@ -89,7 +89,7 @@ require (
8989
github.com/spf13/jwalterweatherman v1.1.0 // indirect
9090
github.com/spf13/pflag v1.0.5 // indirect
9191
github.com/spf13/viper v1.15.0 // indirect
92-
github.com/stretchr/objx v0.5.1 // indirect
92+
github.com/stretchr/objx v0.5.2 // indirect
9393
github.com/subosito/gotenv v1.4.2 // indirect
9494
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
9595
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0
@@ -98,12 +98,12 @@ require (
9898
go.uber.org/dig v1.17.0 // indirect
9999
go.uber.org/multierr v1.11.0 // indirect
100100
go.uber.org/zap v1.24.0 // indirect
101-
golang.org/x/mod v0.13.0 // indirect
102-
golang.org/x/net v0.20.0 // indirect
103-
golang.org/x/sys v0.16.0 // indirect
104-
golang.org/x/term v0.16.0 // indirect
105-
golang.org/x/text v0.14.0 // indirect
106-
golang.org/x/tools v0.14.0 // indirect
101+
golang.org/x/mod v0.33.0 // indirect
102+
golang.org/x/net v0.50.0 // indirect
103+
golang.org/x/sys v0.41.0 // indirect
104+
golang.org/x/term v0.40.0 // indirect
105+
golang.org/x/text v0.34.0 // indirect
106+
golang.org/x/tools v0.42.0 // indirect
107107
google.golang.org/grpc v1.60.1
108108
gopkg.in/ini.v1 v1.67.0 // indirect
109109
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)