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(core): update useReleaseHistory to fetch with the version documents #7463

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

pedrobonamin
Copy link
Contributor

Description

The useReleaseHistory hook was incorrectly constructing the ID of the documents it needs to fetch and construct the history.

Screenshot 2024-09-04 at 09 54 27

What to review

Testing

Notes for release

@pedrobonamin pedrobonamin requested a review from a team as a code owner September 4, 2024 07:55
@pedrobonamin pedrobonamin requested review from ryanbonial and removed request for a team September 4, 2024 07:55
Copy link

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

Copy link
Contributor

github-actions bot commented Sep 4, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Component Testing Report Updated Sep 4, 2024 12:26 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 48s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 37s 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) 47s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 47s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 17s 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) 19s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 37s 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

@@ -21,14 +24,14 @@ export function useReleaseHistory(bundleDocumentsIds: string[]): {
const {dataset, token} = client.config()
const [history, setHistory] = useState<TransactionLogEventWithEffects[]>([])
const queryParams = `tag=sanity.studio.tasks.history&effectFormat=mendoza&excludeContent=true&includeIdentifiedDocumentsOnly=true`

const publishedIds = bundleDocumentsIds.map((id) => getPublishedId(id)).join(',')
const publishedIds = bundleDocumentsIds.map((id) => getVersionId(id, releaseId)).join(',')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might need to rename the const to documentIds or maybe add a comment to clarify? Just bringing it up since we are technically bringing up a bunch of version ids (which are not publishedIds) 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree @RitaDias. Based on my understanding from glancing over the code, at least 🙂.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TRUE missed that rename! will push the update and merge

@pedrobonamin pedrobonamin merged commit cb65f56 into corel Sep 4, 2024
42 checks passed
@pedrobonamin pedrobonamin deleted the corel-114 branch September 4, 2024 12:38
RitaDias pushed a commit that referenced this pull request Oct 3, 2024
…ts (#7463)

* fix(core): update useReleaseHistory to fetch with the version documents

* fix(core): rename publishedIds to versionIds in useReleaseHistory
juice49 pushed a commit that referenced this pull request Oct 4, 2024
…ts (#7463)

* fix(core): update useReleaseHistory to fetch with the version documents

* fix(core): rename publishedIds to versionIds in useReleaseHistory
juice49 pushed a commit that referenced this pull request Oct 7, 2024
…ts (#7463)

* fix(core): update useReleaseHistory to fetch with the version documents

* fix(core): rename publishedIds to versionIds in useReleaseHistory
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.

3 participants