test(endpoint): add process normalize sequencing tests#3909
Conversation
🦋 Changeset detectedLatest commit: c97b4d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: 0 B Total Size: 80.7 kB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Benchmark React
Details
| Benchmark suite | Current: b379653 | Previous: e66cc98 | Ratio |
|---|---|---|---|
data-client: getlist-100 |
141.85 ops/s (± 5.6%) |
136.06 ops/s (± 7.2%) |
0.96 |
data-client: getlist-500 |
37.53 ops/s (± 8.6%) |
40.73 ops/s (± 6.2%) |
1.09 |
data-client: update-entity |
350.99 ops/s (± 9.9%) |
294.12 ops/s (± 7.4%) |
0.84 |
data-client: update-user |
333.33 ops/s (± 7.1%) |
333.33 ops/s (± 8.3%) |
1 |
data-client: getlist-500-sorted |
43.38 ops/s (± 5.8%) |
41.76 ops/s (± 7.1%) |
0.96 |
data-client: update-entity-sorted |
270.27 ops/s (± 7.2%) |
294.12 ops/s (± 5.7%) |
1.09 |
data-client: update-entity-multi-view |
322.58 ops/s (± 7.6%) |
322.58 ops/s (± 7.1%) |
1 |
data-client: list-detail-switch-10 |
7.66 ops/s (± 7.0%) |
6.46 ops/s (± 5.6%) |
0.84 |
data-client: update-user-10000 |
73.81 ops/s (± 14.6%) |
78.12 ops/s (± 1.5%) |
1.06 |
data-client: invalidate-and-resolve |
34.13 ops/s (± 4.3%) |
33.9 ops/s (± 5.5%) |
0.99 |
data-client: unshift-item |
208.33 ops/s (± 3.6%) |
212.77 ops/s (± 3.7%) |
1.02 |
data-client: delete-item |
259.78 ops/s (± 4.6%) |
270.27 ops/s (± 5.2%) |
1.04 |
data-client: move-item |
175.49 ops/s (± 6.4%) |
172.41 ops/s (± 6.2%) |
0.98 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: b379653 | Previous: e66cc98 | Ratio |
|---|---|---|---|
normalizeLong |
459 ops/sec (±0.96%) |
458 ops/sec (±1.77%) |
1.00 |
normalizeLong Values |
421 ops/sec (±0.59%) |
403 ops/sec (±1.01%) |
0.96 |
denormalizeLong |
252 ops/sec (±4.49%) |
279 ops/sec (±5.83%) |
1.11 |
denormalizeLong Values |
228 ops/sec (±3.80%) |
326 ops/sec (±0.48%) |
1.43 |
denormalizeLong donotcache |
1022 ops/sec (±0.10%) |
1087 ops/sec (±0.61%) |
1.06 |
denormalizeLong Values donotcache |
758 ops/sec (±0.26%) |
764 ops/sec (±0.17%) |
1.01 |
denormalizeShort donotcache 500x |
1561 ops/sec (±0.20%) |
1520 ops/sec (±0.09%) |
0.97 |
denormalizeShort 500x |
734 ops/sec (±3.39%) |
988 ops/sec (±1.85%) |
1.35 |
denormalizeShort 500x withCache |
7345 ops/sec (±0.14%) |
7951 ops/sec (±0.13%) |
1.08 |
queryShort 500x withCache |
2996 ops/sec (±0.14%) |
3134 ops/sec (±0.50%) |
1.05 |
buildQueryKey All |
54639 ops/sec (±0.93%) |
49814 ops/sec (±0.40%) |
0.91 |
query All withCache |
6403 ops/sec (±0.35%) |
5680 ops/sec (±0.49%) |
0.89 |
denormalizeLong with mixin Entity |
361 ops/sec (±2.16%) |
350 ops/sec (±2.40%) |
0.97 |
denormalizeLong withCache |
7775 ops/sec (±0.19%) |
7652 ops/sec (±0.56%) |
0.98 |
denormalizeLong Values withCache |
5128 ops/sec (±0.17%) |
6209 ops/sec (±1.48%) |
1.21 |
denormalizeLong All withCache |
6159 ops/sec (±0.24%) |
5440 ops/sec (±0.56%) |
0.88 |
denormalizeLong Query-sorted withCache |
6431 ops/sec (±0.19%) |
5743 ops/sec (±0.13%) |
0.89 |
denormalizeLongAndShort withEntityCacheOnly |
1831 ops/sec (±0.13%) |
1667 ops/sec (±0.18%) |
0.91 |
denormalize bidirectional 50 |
7102 ops/sec (±0.34%) |
6655 ops/sec (±0.23%) |
0.94 |
denormalize bidirectional 50 donotcache |
41164 ops/sec (±1.39%) |
44707 ops/sec (±1.21%) |
1.09 |
getResponse |
4526 ops/sec (±0.60%) |
5600 ops/sec (±1.29%) |
1.24 |
getResponse (null) |
10568521 ops/sec (±0.86%) |
10824484 ops/sec (±0.56%) |
1.02 |
getResponse (clear cache) |
342 ops/sec (±0.30%) |
335 ops/sec (±1.92%) |
0.98 |
getSmallResponse |
3556 ops/sec (±0.19%) |
4075 ops/sec (±0.24%) |
1.15 |
getSmallInferredResponse |
2736 ops/sec (±0.14%) |
2906 ops/sec (±0.05%) |
1.06 |
getResponse Collection |
4582 ops/sec (±0.53%) |
5497 ops/sec (±1.19%) |
1.20 |
get Collection |
4639 ops/sec (±0.25%) |
5463 ops/sec (±0.68%) |
1.18 |
get Query-sorted |
4641 ops/sec (±0.34%) |
5542 ops/sec (±0.27%) |
1.19 |
setLong |
469 ops/sec (±0.37%) |
461 ops/sec (±0.18%) |
0.98 |
setLongWithMerge |
256 ops/sec (±0.29%) |
253 ops/sec (±0.97%) |
0.99 |
setLongWithSimpleMerge |
275 ops/sec (±0.14%) |
271 ops/sec (±0.20%) |
0.99 |
setSmallResponse 500x |
933 ops/sec (±0.96%) |
888 ops/sec (±0.95%) |
0.95 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 35cfc41. Configure here.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3909 +/- ##
=======================================
Coverage 98.11% 98.11%
=======================================
Files 153 153
Lines 2916 2916
Branches 566 566
=======================================
Hits 2861 2861
Misses 11 11
Partials 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9e56061 to
c97b4d0
Compare
Add comprehensive tests verifying that nested entity process() is called with correct parent, key, and args during normalize, covering pk derivation, invalidation, validation, deep nesting, and circular references. Made-with: Cursor
c97b4d0 to
b379653
Compare

Motivation
Verify that nested entity
process()is called with correctparent,key, andargsduring normalize, and that the call sequencing (process → pk → validate → visit children) supports all dependency patterns.Solution
Add a dedicated
process.test.tssuite covering:undefinedtriggers entity invalidationNo production code changes — normalize already handles all of this correctly.
Open questions
N/A
Note
Low Risk
Adds a large new test suite without changing runtime code; risk is limited to longer test execution and potential flakiness if assumptions about normalization behavior differ across environments.
Overview
Adds
process.test.ts, a comprehensive set of normalization tests asserting thatprocess()runs for nested schema members (direct, arrays, and deep chains), preservesnull/missing keys, and correctly handles non-entity schemas likeschema.Collection,schema.Values, and serializable functions.Expands coverage for edge cases where
process()affectspk()/validation, supports invalidation whenprocess()returnsundefined, ensures args/processed-parent propagation to grandchildren, and verifies circular/self-referential entities andEntityMixinparity.Reviewed by Cursor Bugbot for commit b379653. Bugbot is set up for automated code reviews on this repo. Configure here.