Repository navigation
fix(capture): total sameValue in trace de-dup (circular/BigInt) - #135
Conversation
|
Claude finished @krassx's task in 18s —— View job Review of PR #135: total
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Check name | Status | Explanation |
|---|---|---|
| Title check | The title clearly identifies the fix to sameValue de-duplication for circular values and BigInt values in capture traces. |
|
| Description check | The description directly explains the sameValue fix, the handling of circular, BigInt, and throwing toJSON values, and the related tests. |
|
| Linked Issues check | Issue #56 is the only directly linked issue. Its requirement: make the sameValue de-dup in TraceProducerBase.emitIfChanged total, using structural comparison or try/catch that treats the value as … |
|
| Out of Scope Changes check | The whole-PR diff against merge base 769cbbe changes two files only: - packages/capture/src/trace-producer.ts: replaces the sameValue helper with the total version and adds the bigintSafe replac… |
|
| Docstring Coverage | No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… |
Full details: Linked Issues check
-
Explanation
Issue
#56is the only directly linked issue. Its requirement: make thesameValuede-dup inTraceProducerBase.emitIfChangedtotal, using structural comparison or try/catch that treats the value as changed, with circular and BigInt test cases.At head 9407c8d,
packages/capture/src/trace-producer.tsimplements the total path:sameValuereturnstrueonObject.isequality.- It returns
falsewhen either value is not a non-null object, so top-level values are not serialized. Top-level BigInt values still compare byObject.is. - For object pairs, it compares
JSON.stringify(a, bigintSafe)withJSON.stringify(b, bigintSafe)insidetry. Thecatchreturnsfalse, so circular values and throwingtoJSONcount as changed. bigintSafemaps BigInt to{ $bigint: string }, so BigInt inside objects compares by value and differs from the same-looking string.
packages/capture/src/trace-producer.test.tsadds fouremitChangedtests (theemitIfChangedpath) covering circular values, throwingtoJSON, BigInt inside objects, and BigInt versus string. These match the issue's test-first request for circular and BigInt cases.The requirement is met by code and tests. Tests were not executed in this review; the assessment relies on source reading.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff against merge base 769cbbe changes two files only:
packages/capture/src/trace-producer.ts: replaces thesameValuehelper with the total version and adds thebigintSafereplacer and its comment. This is the change the issue requests.packages/capture/src/trace-producer.test.ts: adds four tests for the circular, throwingtoJSON, and BigInt cases. These are test coverage for the same requirement.
No other files are changed, and no exported or public declarations change. The
{ $bigint }tag collision is a documented, accepted edge case inside the same helper. It is not an unrelated change. The commit-summary item for throwingtoJSONcoverage supports the total-comparison requirement, so it is in scope.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
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.
Comment @coderabbitai help to get the list of available commands.
…igInt (#56) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Rebased onto main. Review notes: the three 'pre-existing' items (Map/Set shape, in-place mutation dedup, a circular value that is emitted but later fails bundle serialisation) are out of scope for #56 (which asked for a total comparison); an emitted-circular failure is isolated by the existing provider/exporter error handling, and was dropped silently before this PR, so this is a strict improvement. No findings to fix. Gate: capture tests 975 pass, tsc/biome/cycles clean. |
|
Claude finished @krassx's task in 17s —— View job Re-review of PR #135 after the latest pushI re-read the full diff against No real issues found, so there are no inline findings. My earlier review had no findings either, so nothing is carried over. What I checked
Not caused by this PR
Summary
|
Fixes #56
sameValueinTraceProducerBase.emitIfChangedno longer throws: BigInt inside objects is compared by value via a replacer; any other uncomparable value (circular, throwing toJSON) counts as changed, so the trace is emitted instead of dropped. Tests: circular, BigInt, BigInt-vs-string, throwing toJSON.🤖 Generated with Claude Code