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

Issue-216: Pinned posts that are deleted or unpublished cause problems in editor and on graphql front end #217

Merged

Conversation

mogmarsh
Copy link
Collaborator

@mogmarsh mogmarsh commented Aug 15, 2024

Summary

Fixes #216 - This pull request addresses the issue where pinned posts that are deleted or unpublished cause problems in the editor and on the graphql front end.

Description

If a pinned post is deleted or unpublished, it causes issues in the editor (you can't tell that the post has been pinned) and on the front end in graphql. The solution now includes showing an error in the editor when a pinned post is deleted or unpublished and removing the post's ID from the graphql front end to prevent errors.

Steps To Reproduce

  1. Pin a post
  2. Unpublish that post

Additional Information

No response

@mogmarsh mogmarsh marked this pull request as ready for review August 15, 2024 20:10
Copy link
Contributor

@efuller efuller left a comment

Choose a reason for hiding this comment

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

⚡ For transparency, I did make one change after checking with Greg. Also noted one of item for future reference.

@@ -118,7 +121,7 @@ export function mainDedupe() {
}

// Loop through all query blocks and set backfilled posts in the open slots.
queryBlocks.forEach((queryBlock) => {
queryBlocks.forEach(async (queryBlock) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

While this code does look to work, eventually we will want to refactor the usage of an async callback here. Some recommendations call for use of a for...of loop but it can largely depend on what other functionality we have going on here.

@mogmarsh mogmarsh merged commit 3b20b6e into develop Aug 20, 2024
5 checks passed
@mogmarsh mogmarsh deleted the fix/issue-216/pinned-posts-deletion-unpublish-issues branch August 20, 2024 15:34
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.

Pinned posts that are deleted or unpublished cause problems in editor and on graphql front end
2 participants