Skip to content

fix(nuxt): redact client events received by the ingest endpoint - #838

Merged
HugoRCD merged 1 commit into
mainfrom
fix/redact-client-ingest
Oct 11, 2026
Merged

HugoRCD merged 1 commit into
mainfrom
fix/redact-client-ingest

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

Found while testing the release candidate in a Nuxt app. #821, which is in the pending release #802, started printing client ingest events to stdout, so this should land before that release.

📚 Description

The ingest route builds its own wide event and passes it to enrichers, stdout and drains without going through emitWideEvent, where the global redact config is applied. So in production a browser event came out unmasked while server events were redacted:

{"level":"warn","source":"client","message":"probe","email":"jane@example.com","card":"4242 4242 4242 4242"}

Drains already received these unredacted before #821; #821 also put them on stdout.

Change

A new internal redactWithGlobalConfig(event) in logger.ts applies state.redact and marks the event as redacted, as emitWideEvent does. The ingest route runs it on the client event before enrichers, stdout and drains. With redaction off (the dev default), the event is unchanged.

Tests

  • New ingest test with redact: true: the event printed to stdout and the event passed to evlog:enrich and evlog:drain are masked. The test fails without the fix.
  • The evlog suite passes (2,118 tests), along with build and lint.
  • Checked in a production Nuxt build: a client event's email and card come out as j***@***.com and ****4242.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • Bug Fixes
    • Client-ingested events now follow global redaction settings before appearing in output or being processed by enrichers and drains.

@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evi Ready Ready Preview Oct 11, 2026 8:55pm UTC
evlog-docs Ready Ready Preview, v0 Oct 11, 2026 8:55pm UTC
evlog-render-lab Ready Ready Preview Oct 11, 2026 8:55pm UTC
evlog-telemetry Ready Ready Preview Oct 11, 2026 8:55pm UTC
just-use-evlog Ready Ready Preview Oct 11, 2026 8:55pm UTC

Request Review

@github-actions github-actions Bot added the bug Something isn't working label Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Oct 11, 2026

Copy link
Copy Markdown
@evlog/cli

npm i https://pkg.pr.new/@evlog/cli@838

evlog

npm i https://pkg.pr.new/evlog@838

@evlog/nuxthub

npm i https://pkg.pr.new/@evlog/nuxthub@838

@evlog/signals

npm i https://pkg.pr.new/@evlog/signals@838

@evlog/telemetry

npm i https://pkg.pr.new/@evlog/telemetry@838

commit: 9bf0213

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0e4c33bd-7ed3-48f9-aaaa-c9228b6387d5

📥 Commits

Reviewing files that changed from the base of the PR and between f3613ee and 9bf0213.


📒 Files selected for processing (4)
  • .changeset/redact-client-ingest.md
  • packages/evlog/src/logger.ts
  • packages/evlog/src/runtime/server/routes/_evlog/ingest.post.ts
  • packages/evlog/test/nuxt/ingest-output.test.ts

 ________________________________________________________
< Congrats on shipping. Unfortunately, you shipped *it*. >
 --------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@HugoRCD
HugoRCD merged commit 94043b1 into main Oct 11, 2026
21 of 22 checks passed
@HugoRCD
HugoRCD deleted the fix/redact-client-ingest branch October 11, 2026 20:59

This branch was successfully deployed

5 active deployments
Preview – evlog-telemetry — 9bf02133 Deployed Oct 11, 2026 by vercel[bot]
Preview – evi — 9bf02133 Deployed Oct 11, 2026 by vercel[bot]
Preview – evlog-docs — 9bf02133 Deployed Oct 11, 2026 by vercel[bot]
Preview – just-use-evlog — 9bf02133 Deployed Oct 11, 2026 by vercel[bot]
Preview – evlog-render-lab — 9bf02133 Deployed Oct 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant