Skip to content

fix(web): cache server console context#38535

Merged
lyzno1 merged 1 commit into
mainfrom
codex/cache-server-console-context
Jul 8, 2026
Merged

fix(web): cache server console context#38535
lyzno1 merged 1 commit into
mainfrom
codex/cache-server-console-context

Conversation

@lyzno1

@lyzno1 lyzno1 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Cache the server console request context with React cache() for request-scoped dedupe.
  • Preserve the existing server-only console transport and forwarded cookie/csrf behavior.

Verification

  • pnpm -C web test -- service/__tests__/server.spec.ts
  • pnpm -C web test -- app/(commonLayout)/__tests__/hydration-boundary.spec.tsx
  • pnpm -C web test -- features/system-features/__tests__/system-features.spec.ts
  • git diff --check

Manual Check

  • Temporary server logging showed one / render previously called getServerConsoleClientContext() 3 times.
  • After wrapping with React cache(), the same page render emitted one context log per request wave.

@lyzno1 lyzno1 requested a review from iamjoel as a code owner July 8, 2026 05:23
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 8, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 8, 2026
@lyzno1 lyzno1 enabled auto-merge July 8, 2026 05:25
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.34%. Comparing base (6ac7ff6) to head (afab426).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #38535      +/-   ##
==========================================
- Coverage   85.39%   85.34%   -0.06%     
==========================================
  Files        5170     5013     -157     
  Lines      270183   265787    -4396     
  Branches    51604    50528    -1076     
==========================================
- Hits       230719   226829    -3890     
+ Misses      35016    34510     -506     
  Partials     4448     4448              
Flag Coverage Δ
cli ?
dify-ui 94.61% <ø> (ø)
web 84.90% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1 lyzno1 added this pull request to the merge queue Jul 8, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 8, 2026
Merged via the queue into main with commit 41fb479 Jul 8, 2026
40 checks passed
@lyzno1 lyzno1 deleted the codex/cache-server-console-context branch July 8, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants