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

refactor: pass includeAllVersions to listeners #8674

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Feb 17, 2025

Description

In order to prepare for an upcoming API change, we want to explicitly add includeAllVersions to all the /listen calls made by the Studio.

What to review

  • Ideally, after this PR, there shouldn't be any listen calls made from the studio that doesn't pass includeAllVersions. It's only a critical requirement for new code paths that will expect version documents, but for consistency it makes sense to use it everywhere.

Testing

  • A bit of manual testing required unfortunately; open the studio with these changes applied, make sure all listen requests going from the studio are passing includeAllVersions=true

Notes for release

n/a – internal

Copy link

vercel bot commented Feb 17, 2025

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 Feb 17, 2025 3:51pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2025 3:51pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2025 3:51pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Feb 17, 2025 3:51pm
test-next-studio ⬜️ Ignored (Inspect) Feb 17, 2025 3:51pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 17, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.75% 54388 / 127194
🔵 Statements 42.75% 54388 / 127194
🔵 Functions 48.09% 2787 / 5795
🔵 Branches 79.38% 10573 / 13319
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/@sanity/vision/src/components/VisionGui.tsx 0% 0% 0% 0% 1-1151
packages/sanity/src/core/comments/store/useCommentsStore.ts 18.18% 100% 0% 18.18% 68-204
packages/sanity/src/core/preview/createGlobalListener.ts 100% 100% 33.33% 100%
packages/sanity/src/core/preview/liveDocumentIdSet.ts 7.07% 100% 33.33% 7.07% 21-103, 106-117
packages/sanity/src/core/releases/store/createReleaseMetadataAggregator.ts 8% 100% 25% 8% 24-43, 55-102, 105-149, 152
packages/sanity/src/core/store/_legacy/document/getPairListener.ts 75.79% 96.42% 75% 75.79% 58-71, 84-85, 119, 134-135, 138-151, 174, 183, 190-200
packages/sanity/src/core/store/_legacy/document/listenQuery.ts 80.48% 64.28% 83.33% 80.48% 74-82, 90-95, 111-112
packages/sanity/src/core/tasks/store/useTasksStore.ts 50% 71.42% 100% 50% 58-69, 75-118, 125-132, 139-140
packages/sanity/src/presentation/overlays/PostMessageDocuments.tsx 0% 0% 0% 0% 1-111
packages/sanity/src/structure/panes/documentList/listenSearchQuery.ts 67.88% 58.33% 50% 67.88% 86-94, 120, 131-134, 145-165, 171-173
packages/sanity/src/structure/panes/documentList/sheetList/useDocumentSheetListStore.ts 8.69% 100% 0% 8.69% 36-102, 127-248
Generated in workflow #30583 for commit c72f156 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Feb 17, 2025

Component Testing Report Updated Feb 17, 2025 4:01 PM (UTC)

❌ Failed Tests (5) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 18s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 41s 3 0 3
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 59s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ❌ Failed (Inspect) 1m 57s 14 0 1
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 51s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ❌ Failed (Inspect) 3m 0s 20 0 1
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 2m 0s 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

⚡️ Editor Performance Report

Updated Mon, 17 Feb 2025 15:59:13 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.4 efps (41ms) 25.0 efps (40ms) -1ms (-2.4%)
article (body) 65.4 efps (15ms) 71.9 efps (14ms) -1ms (-/-%)
article (string inside object) 27.0 efps (37ms) 25.6 efps (39ms) +2ms (+5.4%)
article (string inside array) 23.8 efps (42ms) 22.7 efps (44ms) +2ms (+4.8%)
recipe (name) 48.8 efps (21ms) 50.0 efps (20ms) -1ms (-2.4%)
recipe (description) 52.6 efps (19ms) 55.6 efps (18ms) -1ms (-5.3%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 21.3 efps (47ms) 20.4 efps (49ms) +2ms (+4.3%)
synthetic (string inside object) 20.6 efps (49ms) 20.8 efps (48ms) -1ms (-1.0%)

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) 41ms 46ms 54ms 284ms 162ms 10.9s
article (body) 15ms 18ms 26ms 171ms 190ms 5.7s
article (string inside object) 37ms 40ms 43ms 213ms 341ms 6.8s
article (string inside array) 42ms 45ms 52ms 169ms 396ms 7.3s
recipe (name) 21ms 24ms 26ms 50ms 0ms 7.3s
recipe (description) 19ms 20ms 23ms 30ms 0ms 4.6s
recipe (instructions) 5ms 7ms 8ms 20ms 0ms 3.2s
synthetic (title) 47ms 48ms 56ms 304ms 592ms 14.0s
synthetic (string inside object) 49ms 51ms 70ms 441ms 791ms 8.2s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 40ms 44ms 53ms 318ms 195ms 11.2s
article (body) 14ms 18ms 23ms 196ms 208ms 5.4s
article (string inside object) 39ms 41ms 47ms 204ms 303ms 7.1s
article (string inside array) 44ms 46ms 53ms 143ms 264ms 7.4s
recipe (name) 20ms 22ms 25ms 61ms 0ms 7.7s
recipe (description) 18ms 19ms 22ms 33ms 0ms 4.5s
recipe (instructions) 5ms 6ms 8ms 12ms 0ms 3.1s
synthetic (title) 49ms 51ms 55ms 237ms 599ms 12.9s
synthetic (string inside object) 48ms 50ms 54ms 439ms 569ms 8.5s

📚 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.

Copy link
Member

@jordanl17 jordanl17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I thought there'd be more listens actually so good there aren't so many

@bjoerge bjoerge merged commit d74e9d7 into next Feb 18, 2025
62 checks passed
@bjoerge bjoerge deleted the sapp-2047-include-all-versions branch February 18, 2025 12:13
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