Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes schema extraction with nested union refs #8096

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

rneatherway
Copy link
Contributor

This was seen in a schema produced by automated tooling. The recursion
guard was too strict in this case as the two occurrences of a
reference ending up having the same guard path name and extraction
would therefore abort before looking inside the second one, instead
returning {} which would fail when attempting to inspect the name
field a little lower down.

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 0:59am
performance-studio ✅ Ready (Inspect) Visit Preview Jan 7, 2025 0:59am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 0:59am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 0:59am
test-next-studio ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 0:59am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Component Testing Report Updated Jan 7, 2025 1:01 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 3s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 40s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 50s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 7s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 27s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 38s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 12s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 42s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Dec 18, 2024

⚡️ Editor Performance Report

Updated Tue, 07 Jan 2025 13:04:31 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 21.7 efps (46ms) 24.4 efps (41ms) -5ms (-10.9%)
article (body) 53.3 efps (19ms) 50.3 efps (20ms) +1ms (+6.1%)
article (string inside object) 24.4 efps (41ms) 26.3 efps (38ms) -3ms (-7.3%)
article (string inside array) 20.8 efps (48ms) 23.8 efps (42ms) -6ms (-12.5%)
recipe (name) 45.5 efps (22ms) 52.6 efps (19ms) -3ms (-13.6%)
recipe (description) 50.0 efps (20ms) 62.5 efps (16ms) -4ms (-20.0%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (title) 18.0 efps (56ms) 20.0 efps (50ms) -6ms (-9.9%)
synthetic (string inside object) 18.5 efps (54ms) 20.8 efps (48ms) -6ms (-11.1%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 46ms 59ms 75ms 457ms 985ms 10.7s
article (body) 19ms 21ms 26ms 262ms 241ms 5.8s
article (string inside object) 41ms 44ms 50ms 84ms 360ms 7.4s
article (string inside array) 48ms 52ms 67ms 173ms 702ms 8.1s
recipe (name) 22ms 25ms 29ms 45ms 0ms 7.2s
recipe (description) 20ms 21ms 27ms 42ms 0ms 4.8s
recipe (instructions) 6ms 7ms 9ms 10ms 0ms 3.1s
synthetic (title) 56ms 59ms 67ms 120ms 1063ms 13.3s
synthetic (string inside object) 54ms 56ms 63ms 296ms 983ms 8.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 41ms 63ms 70ms 453ms 903ms 10.9s
article (body) 20ms 25ms 47ms 197ms 408ms 6.7s
article (string inside object) 38ms 40ms 43ms 182ms 296ms 7.1s
article (string inside array) 42ms 44ms 46ms 87ms 162ms 6.9s
recipe (name) 19ms 20ms 25ms 37ms 0ms 7.3s
recipe (description) 16ms 17ms 18ms 27ms 0ms 4.2s
recipe (instructions) 6ms 7ms 9ms 27ms 0ms 3.1s
synthetic (title) 50ms 53ms 60ms 264ms 500ms 13.0s
synthetic (string inside object) 48ms 50ms 58ms 241ms 702ms 8.6s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@rneatherway
Copy link
Contributor Author

I tried updating the snapshots using pnpm test -- -u but I get a lot of errors e.g.

 FAIL  src/core/studio/components/navbar/search/contexts/search/reducer.test.ts > searchReducer > should not merge results after fetching an additional page when not using `textSearch` strategy
TypeError: Cannot read properties of undefined (reading 'match')
 ❯ src/core/studio/components/navbar/search/contexts/search/reducer.test.ts:294:31
    292|     const [state] = result.current
    293|
    294|     expect(state.result.hits).toMatchInlineSnapshot(`
       |                               ^
    295|       [
    296|         {

I checked and that's the same on next for me. Any advice?

rneatherway and others added 2 commits January 7, 2025 13:51
This was seen in a schema produced by automated tooling. The recursion
guard was too strict in this case as the two occurrences of a
reference ending up having the same guard path name and extraction
would therefore abort before looking inside the second one, instead
returning `{}` which would fail when attempting to inspect the name
field a little lower down.
@bjoerge bjoerge added this pull request to the merge queue Jan 7, 2025
Merged via the queue into next with commit ac62487 Jan 7, 2025
56 checks passed
@bjoerge bjoerge deleted the rneatherway/fix-extract-union-refs branch January 7, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants