Skip to content

fix(core): use raw perspective for functions that coalesce draft/published #503

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cngonzalez
Copy link
Member

Description

In their respective stores, reviews and projections coalesce draft and query results and return a "status" object that includes params for when the draft was last edited and when the published version was last edited, so people could indicate the status of the document. However, they were also using the drafts perspective, which does the coalescing in the query result so everything was mistakenly "published" from the status perspective.

This restores the raw perspective.

What to review

It's a larger question about what we want to do about "status". This may only get more complex once we introduce perspectives. Are we going to return the version document and the published document?

Should we just use the drafts perspective and get the data some other way?

Fun gif

@cngonzalez cngonzalez requested a review from a team as a code owner May 5, 2025 17:03
@cngonzalez cngonzalez requested a review from colepeters May 5, 2025 17:03
Copy link

vercel bot commented May 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
sdk-kitchensink-react ✅ Ready (Inspect) Visit Preview May 5, 2025 5:03pm

Copy link

github-actions bot commented May 5, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 95.96% (🎯 95%) 6556 / 6832
🟢 Statements 95.96% (🎯 95%) 6556 / 6832
🟢 Functions 95.6% (🎯 95%) 326 / 341
🟢 Branches 94.64% (🎯 90%) 2052 / 2168
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/preview/util.ts 100% 100% 100% 100%
packages/core/src/projection/util.ts 100% 100% 100% 100%
Generated in workflow #1398 for commit 3ca0350 by the Vitest Coverage Report Action

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.

1 participant