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: Scheduled publishing badge issue #8510

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

Conversation

bobinska-dev
Copy link

@bobinska-dev bobinska-dev commented Feb 5, 2025

Added check for missing upcomingSchedule.action

Description

fix for: ScheduledBadge is rendered with an invalid state causing the component to crash the Studio

Added check for missing upcoming schedule action

What to review

Testing

Notes for release

Bug: When upcomingSchedule.action is undefined, the Studio breaks due to a missing check.

This line causes it:

  if (!upcomingSchedule || !upcomingSchedule.executeAt) {
    return null
  }

Fix:

  if (!upcomingSchedule || !upcomingSchedule.executeAt || !upcomingSchedule.action) {
    return null
  }

@bobinska-dev bobinska-dev requested a review from a team as a code owner February 5, 2025 12:51
@bobinska-dev bobinska-dev requested review from RitaDias and removed request for a team February 5, 2025 12:51
Copy link

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

Copy link
Contributor

github-actions bot commented Feb 5, 2025

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.39% 53648 / 126540
🔵 Statements 42.39% 53648 / 126540
🔵 Functions 47.86% 2763 / 5772
🔵 Branches 78.79% 10284 / 13051
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/scheduledPublishing/plugin/documentBadges/scheduled/ScheduledBadge.tsx 28.57% 100% 0% 28.57% 15-32
Generated in workflow #29864 for commit 2fc775b by the Vitest Coverage Report Action

@bobinska-dev bobinska-dev self-assigned this Feb 5, 2025
RitaDias
RitaDias previously approved these changes Feb 5, 2025
Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

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

How nice to see your face around these parts @bobinska-dev 😄
This looks good and I tested it on the deployment and seems to work well!

Nice work!

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Component Testing Report Updated Feb 5, 2025 1:09 PM (UTC)

❌ Failed Tests (1) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 7s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 1m 19s 5 0 1
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 51s 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 8s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 30s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 2s 21 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 43s 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 Feb 5, 2025

⚡️ Editor Performance Report

Updated Wed, 05 Feb 2025 13:11:23 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 20.0 efps (50ms) 23.5 efps (43ms) -8ms (-15.0%)
article (body) 69.9 efps (14ms) 67.3 efps (15ms) +1ms (-/-%)
article (string inside object) 24.4 efps (41ms) 23.8 efps (42ms) +1ms (+2.4%)
article (string inside array) 20.8 efps (48ms) 21.3 efps (47ms) -1ms (-2.1%)
recipe (name) 48.8 efps (21ms) 47.6 efps (21ms) +1ms (+2.4%)
recipe (description) 52.6 efps (19ms) 52.6 efps (19ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 18.2 efps (55ms) 18.0 efps (56ms) +1ms (+0.9%)
synthetic (string inside object) 18.5 efps (54ms) 18.9 efps (53ms) -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) 50ms 73ms 80ms 517ms 1322ms 12.3s
article (body) 14ms 19ms 34ms 300ms 511ms 5.9s
article (string inside object) 41ms 44ms 48ms 306ms 467ms 7.5s
article (string inside array) 48ms 51ms 56ms 181ms 749ms 8.4s
recipe (name) 21ms 23ms 24ms 40ms 0ms 7.2s
recipe (description) 19ms 20ms 22ms 30ms 0ms 4.6s
recipe (instructions) 5ms 6ms 8ms 21ms 0ms 3.1s
synthetic (title) 55ms 60ms 113ms 447ms 1446ms 18.6s
synthetic (string inside object) 54ms 64ms 112ms 780ms 1895ms 9.7s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 43ms 51ms 74ms 479ms 880ms 11.5s
article (body) 15ms 18ms 24ms 186ms 278ms 5.6s
article (string inside object) 42ms 45ms 50ms 144ms 295ms 7.4s
article (string inside array) 47ms 49ms 56ms 194ms 427ms 7.5s
recipe (name) 21ms 22ms 27ms 52ms 0ms 7.3s
recipe (description) 19ms 20ms 21ms 28ms 0ms 4.6s
recipe (instructions) 5ms 6ms 9ms 22ms 0ms 3.1s
synthetic (title) 56ms 60ms 106ms 332ms 1031ms 13.2s
synthetic (string inside object) 53ms 56ms 68ms 295ms 1188ms 8.8s

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

@bobinska-dev
Copy link
Author

@RitaDias I am daring to do more now 😎 although all the real work was done by @azaxarov 🙌

The only check that failed was related to component testing of PTE annotations, which is unrelated to this... Not sure how to proceed from here

@RitaDias
Copy link
Contributor

RitaDias commented Feb 5, 2025

@RitaDias I am daring to do more now 😎 although all the real work was done by @azaxarov 🙌

The only check that failed was related to component testing of PTE annotations, which is unrelated to this... Not sure how to proceed from here

Replied on the linear story, let's hold on merging just for a 🤏

pedrobonamin
pedrobonamin previously approved these changes Feb 5, 2025
Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

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

Thank you!

@pedrobonamin pedrobonamin dismissed stale reviews from RitaDias and themself February 5, 2025 16:24

The merge-base changed after approval.

@pedrobonamin pedrobonamin requested a review from a team as a code owner February 5, 2025 16:24
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.

6 participants