Repository navigation
fix(core): keep toJSON hidden fields hidden on a second set() - #899
evlogai[bot] wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Thank you for following the naming conventions! 🙏 |
|
Closing this as superseded. #898 already merged the same ELI5Another run of the same fix landed on the main branch just before this one. This copy would only clash with it, so it is being closed. The fix is already on the main branch. |
Refs EVL-689
Summary
Ports the
writableChildchange from #894 tomain. #894 landed onv3, where the fix is already present. This branch brings it tomainbefore 2.33.0 so the regression never ships.When
log.set()merges into a key that already holds a plain object,writableChildcopies that object with a spread. A spread drops a non-enumerabletoJSON, so the copy lost the method that hid a field. A secondset()on the same key then exposed the hidden field. The copy now keepstoJSON.Scope is limited to
packages/evlog/src/logger.ts, its regression test, and one changeset. No other change from #894 is ported.Before and after
Input, logged twice under the same key:
Checks
9ccfe4f). Onmainit fails withReceived: {"visible":1,"secret":"hunter2","extra":2}. With the fix it passes.pnpm run typecheck: 30 of 30 tasks green.pnpm run lint: 25 of 25 tasks green.pnpm --filter evlog run test: 119 files, 2288 tests pass.pnpm --filter @evlog/signals run test: 5 files, 32 tests pass. In the first full-workspace run this package hit a vitest worker startup timeout under parallel load. It passes when run alone, and it does not depend onlogger.ts.pnpm run test; the per-package runs above are what I can vouch for.Changeset
"evlog": patch:log.set()no longer exposes fields hidden by atoJSONmethod when the same key is set twice (regression in an unreleased change).Release order
This should merge before #858. Once it lands on
main, the Changesets action refreshes #858 with the new entry.ELI5
Our logger copies an object before adding to it. The copy forgot a hidden rule that says "don't show this field". So if you added data to the same object twice, the hidden field showed up in the logs. This change keeps that rule on the copy, so hidden fields stay hidden.