Skip to content

Commit f23beba

Browse files
ihabadhamclaude
andcommitted
Gate LiveActivity 300ms delay on RSC_SUSPENSE_DEMO_DELAY
The setTimeout was firing on every request, including production deployments — verified via curl on the review-app: /rsc_payload/ LiveActivity took ~1000ms vs ~620ms for /rsc_payload/ServerComponentsPage across 3 trials, ~400ms gap matching the unconditional 300ms delay. Same opt-in gate as CommentsFeed: enabled when env var is exactly 'true', off by default. Review-app keeps the visible behavior because app.yml sets RSC_SUSPENSE_DEMO_DELAY=true. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 09b113e commit f23beba

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

client/app/bundles/server-components/ror_components/LiveActivity.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ async function LiveActivity({ simulateError = false }) {
66
throw new Error('Simulated server-side render failure (demo)');
77
}
88

9-
// Small delay so the refresh-in-flight state is visible.
10-
await new Promise((resolve) => {
11-
setTimeout(resolve, 300);
12-
});
9+
// Opt-in delay so the refresh-in-flight state is visible in the demo.
10+
// Matches the gate in CommentsFeed; off by default in production.
11+
if (process.env.RSC_SUSPENSE_DEMO_DELAY === 'true') {
12+
await new Promise((resolve) => {
13+
setTimeout(resolve, 300);
14+
});
15+
}
1316

1417
const stats = {
1518
serverTime: new Date().toISOString(),

0 commit comments

Comments
 (0)