Skip to content
Source
Docs
Explore
Skills
MCP servers
For agents
Search or jump to…
Sign in
Sign up
pingdotgg
/
t3code
Pull requests
pingdotgg
t3code
Public
Synced with GitHub
Popular #1
Fork
0
0
0
0
1
2
3
4
5
6
7
8
9
Code
Architecture
Issues
Pull requests
Community
Assets
CI
Agents
Settings
fix(server): preview viewers connect even when the tab's renderer stops answering
#27663
Send to my agent
Closed
juliusmarminge
wants to merge 2 commits into
main
from
fix/issue-27610
·
opened
last month
View on GitHub
Conversation
6
Commits
2
Files changed
2
Impact
Showing
2 changed files
with
57 additions
and
5 deletions
.
x
0 of 2 viewed, 2 left
Files
Hide whitespace
Unified
Split
50 additions and 1 deletion
+50
-1
apps/server/src/preview/ServerBrowser.test.ts
Modified
Diff
Before/After
Viewed
apps/server/src/preview/ServerBrowser.test.ts
View file
Expand up
Show all 23 lines
@@ -24,6 +24,7 @@
24
24
import
*
as
PubSub
from
"effect/PubSub"
;
25
25
import
*
as
Queue
from
"effect/Queue"
;
26
26
import
*
as
Stream
from
"effect/Stream"
;
27
+
import
*
as
TestClock
from
"effect/testing/TestClock"
;
27
28
import
type
{
BrowserContext
,
Page
}
from
"playwright-core"
;
28
29
import
{ beforeEach, expect, vi }
from
"vite-plus/test"
;
29
30
Expand up
Expand down
Show all 60 lines
@@ -90,6 +91,7 @@
90
91
emit: (name:
string
) => events.
emit
(name),
91
92
detach: vi.
fn
(
async
() => {}),
92
93
send: vi.
fn
(
async
(method:
string
, input?:
unknown
):
Promise
<
Record
<
string
,
unknown
>> => {
94
+
if
(stalledRenderer &&
STALLED_RENDERER_METHODS
.
has
(method))
await
stalledRenderer
();
93
95
if
(method ===
"Page.getNavigationHistory"
)
return
{
currentIndex
:
0
,
entries
: [{}] };
94
96
if
(method ===
"Page.getLayoutMetrics"
)
return
{
cssVisualViewport
: {
pageX
:
0
,
pageY
:
0
} };
95
97
if
(method ===
"Page.captureScreenshot"
) {
Expand up
Expand down
Show all 166 lines
@@ -262,6 +264,13 @@
262
264
const
encoderStreams:
Array
<{ frameRate:
number
|
undefined
; bitsPerSecond:
number
}> = [];
263
265
const
contextRequests:
Array
<{ profileId:
string
; isolated:
boolean
}> = [];
264
266
let
contextGate:
PromiseWithResolvers
<
void
> |
null
=
null
;
267
+
// A renderer whose main thread is stuck never answers these.
268
+
const
STALLED_RENDERER_METHODS
=
new
Set
([
269
+
"Page.startScreencast"
,
270
+
"Page.stopScreencast"
,
271
+
"Page.captureScreenshot"
,
272
+
]);
273
+
let
stalledRenderer: (() =>
Promise
<
void
>) |
null
=
null
;
265
274
let
pageCopy =
""
;
Home
Search
Explore
Menu