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(releases): when reverting, published versions are used to derive translog #8112

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

jordanl17
Copy link
Member

@jordanl17 jordanl17 commented Dec 19, 2024

Description

Wrongly, the translog for the version of the document in the published release was being used to derive the revert state for each document. This worked in most cases because the first translog record for the version document is copying the existing publish document - but this fails when the published document is updated before publish but after release creation; or in other cases such as when a document is unpublished in a release.

This PR updates this so that the translog of the published document is always used to lookup the transaction of the release publish. As previously this will also:

  1. usePostPublishTransactions checks if there are any transactions after the publish tranaction
  2. useDocumentRevertStates which derives the revert state by looking at the transaction 1 prior to the publish trans

What to review

Testing

Some minor test updates made to correct for the fact that the documents provided to the hooks are the version documents, and then additional mock updates to reflect the changes to logic

Notes for release

N/A

Copy link

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

Copy link
Member Author

Choose a reason for hiding this comment

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

File moved into __tests__ dir

@jordanl17 jordanl17 force-pushed the fix-corel-revert-use-published branch from e82dc3b to a19295d Compare December 19, 2024 15:38
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Component Testing Report Updated Dec 20, 2024 4:14 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 4s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 39s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 52s 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 28s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 41s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 45s 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 19, 2024

⚡️ Editor Performance Report

Updated Fri, 20 Dec 2024 16:17:05 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.0 efps (37ms) 17.5 efps (57ms) +20ms (+54.1%) 🔴
article (body) 63.7 efps (16ms) 63.3 efps (16ms) +0ms (-/-%)
article (string inside object) 27.8 efps (36ms) 19.6 efps (51ms) +15ms (+41.7%) 🔴
article (string inside array) 23.8 efps (42ms) 17.7 efps (57ms) +15ms (+34.5%) 🔴
recipe (name) 55.6 efps (18ms) 32.3 efps (31ms) +13ms (+72.2%) 🔴
recipe (description) 62.5 efps (16ms) 35.7 efps (28ms) +12ms (+75.0%) 🔴
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 19.6 efps (51ms) 7.9 efps (127ms) +76ms (+148.0%) 🔴
synthetic (string inside object) 19.6 efps (51ms) 8.4 efps (120ms) +69ms (+134.3%) 🔴

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) 37ms 40ms 43ms 396ms 147ms 9.5s
article (body) 16ms 17ms 23ms 99ms 275ms 5.4s
article (string inside object) 36ms 38ms 41ms 166ms 140ms 6.6s
article (string inside array) 42ms 43ms 51ms 97ms 139ms 6.9s
recipe (name) 18ms 20ms 23ms 50ms 0ms 7.0s
recipe (description) 16ms 17ms 20ms 36ms 0ms 4.3s
recipe (instructions) 5ms 7ms 8ms 20ms 0ms 3.0s
synthetic (title) 51ms 54ms 59ms 269ms 522ms 12.9s
synthetic (string inside object) 51ms 56ms 59ms 303ms 421ms 8.5s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 57ms 77ms 92ms 648ms 1621ms 12.7s
article (body) 16ms 19ms 36ms 151ms 400ms 5.5s
article (string inside object) 51ms 55ms 61ms 69ms 478ms 8.0s
article (string inside array) 57ms 58ms 65ms 183ms 763ms 8.7s
recipe (name) 31ms 33ms 41ms 65ms 27ms 8.2s
recipe (description) 28ms 30ms 35ms 53ms 28ms 5.6s
recipe (instructions) 5ms 7ms 8ms 15ms 0ms 3.1s
synthetic (title) 127ms 138ms 234ms 581ms 6133ms 20.1s
synthetic (string inside object) 120ms 130ms 135ms 484ms 5447ms 14.9s

📚 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

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

Great catch, and great fix!

@jordanl17 jordanl17 merged commit d6c6663 into corel Dec 20, 2024
57 checks passed
@jordanl17 jordanl17 deleted the fix-corel-revert-use-published branch December 20, 2024 17:20
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