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(sanity): reset search cursor state when any parameter changes #7889

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Nov 27, 2024

Description

This branch fixes global search pagination bugs caused by the cursor state not correctly being reset when some input parameters change. For example, when removing a filter, the cursor was not being reset. This could cause the next result set to be fetched using a cursor for the previously active set of filters.

This isn't currently a problem, because global search results aren't paginated. However, we will begin using pagination when we soon introduce the new GROQ search strategy.

What to review

  • Global search input parameters and predicated builder (e.g. filters).

Testing

  • Added unit tests to the reducer to ensure cursor state is reset when input parameters change.

snorrees and others added 5 commits November 26, 2024 14:51
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Carolina Gonzalez <carolina.nicole.gonzalez@gmail.com>
Copy link

vercel bot commented Nov 27, 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 Nov 27, 2024 0:36am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:36am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:36am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:36am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Nov 27, 2024 0:36am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Nov 27, 2024 12:32 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 39s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 11s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 51s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 18s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 27s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 36s 12 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 Wed, 27 Nov 2024 12:35:00 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 22.2 efps (45ms) 21.7 efps (46ms) +1ms (+2.2%)
article (body) 53.1 efps (19ms) 58.0 efps (17ms) -2ms (-8.5%)
article (string inside object) 24.4 efps (41ms) 23.0 efps (44ms) +3ms (+6.1%)
article (string inside array) 21.7 efps (46ms) 20.4 efps (49ms) +3ms (+6.5%)
recipe (name) 42.6 efps (24ms) 45.5 efps (22ms) -2ms (-6.4%)
recipe (description) 50.0 efps (20ms) 50.0 efps (20ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (7ms) 99.9+ efps (7ms) +0ms (-/-%)
synthetic (title) 17.2 efps (58ms) 17.5 efps (57ms) -1ms (-1.7%)
synthetic (string inside object) 18.9 efps (53ms) 18.5 efps (54ms) +1ms (+1.9%)

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) 45ms 47ms 53ms 201ms 192ms 11.5s
article (body) 19ms 21ms 38ms 184ms 277ms 6.1s
article (string inside object) 41ms 42ms 48ms 288ms 295ms 7.4s
article (string inside array) 46ms 48ms 50ms 100ms 142ms 7.5s
recipe (name) 24ms 26ms 33ms 56ms 0ms 8.3s
recipe (description) 20ms 22ms 26ms 52ms 0ms 5.1s
recipe (instructions) 7ms 9ms 10ms 21ms 0ms 3.4s
synthetic (title) 58ms 61ms 62ms 160ms 462ms 13.1s
synthetic (string inside object) 53ms 57ms 68ms 487ms 946ms 8.5s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 46ms 51ms 66ms 185ms 273ms 12.2s
article (body) 17ms 20ms 25ms 188ms 240ms 5.9s
article (string inside object) 44ms 47ms 52ms 108ms 286ms 7.4s
article (string inside array) 49ms 51ms 63ms 180ms 309ms 8.1s
recipe (name) 22ms 24ms 28ms 62ms 0ms 8.2s
recipe (description) 20ms 22ms 25ms 38ms 0ms 4.9s
recipe (instructions) 7ms 9ms 10ms 25ms 0ms 3.4s
synthetic (title) 57ms 60ms 69ms 314ms 740ms 13.8s
synthetic (string inside object) 54ms 62ms 70ms 523ms 1086ms 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.

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