Skip to content

Commit ea30ad2

Browse files
committed
fix(next): align with route-handler framing in 16.4.5 and hash Bun patches into turbo tasks
1 parent 66d461d commit ea30ad2

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎apps/sim/lib/core/utils/sse.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
2-
* Standard headers for Server-Sent Events responses
2+
* Standard headers for Server-Sent Events responses. `no-transform` keeps Next's response
3+
* compression and intermediaries from buffering the stream to compress it.
34
*/
45
export const SSE_HEADERS = {
56
'Content-Type': 'text/event-stream',
6-
'Cache-Control': 'no-cache',
7+
'Cache-Control': 'no-cache, no-transform',
78
Connection: 'keep-alive',
89
'X-Accel-Buffering': 'no',
910
} as const

‎apps/sim/lib/mothership/request/session/sse.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@ export function encodeSSEEnvelope(envelope: unknown): Uint8Array {
1414
return encoder.encode(`data: ${JSON.stringify(presented)}\n\n`)
1515
}
1616

17-
export const SSE_RESPONSE_HEADERS = {
18-
...SSE_HEADERS,
19-
'Content-Encoding': 'none',
20-
} as const
17+
export const SSE_RESPONSE_HEADERS = SSE_HEADERS

‎turbo.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
// invalidate the cache.
1919
"cacheMaxAge": "7d",
2020
"cacheMaxSize": "40GB",
21+
// Bun applies `patches/*` to installed dependencies, but `bun.lock` records only each patch's
22+
// path, so editing a patch leaves every task hash unchanged and replays a build of the
23+
// unpatched dependency. Hash the patch contents into every task.
24+
"globalDependencies": ["patches/**"],
2125
"tasks": {
2226
"ci:runtime": {
2327
"dependsOn": ["^ci:runtime"],

0 commit comments

Comments
 (0)