fix(workspaces): guard the workspace page against version skew - #777
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(workspaces): guard the workspace page against version skew#777posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Validate the workspace page payload against workspacePageSchema at the react-query boundary. When a deploy drops a field the running bundle still reads, the shape no longer matches, so the tab reloads once to pull the current bundle instead of crashing the render. Generated-By: PostHog Desktop Task-Id: 083d3fd1-10a9-4bcc-8370-ab0cb5fe6ea6
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
workspacePageSchemaat the react-query boundary inworkspacePageQueryOptions. A shape mismatch means the running bundle is stale relative to the server.sessionStoragemarker) to pull the current bundle, rather than letting a downstream read crash the render.Why the fix lives at the query boundary
createServerFnvalidates request input only — it has no response validation. The server guarantees the shape at the TypeScript type level, not at runtime.Scope note
applyWorkspacePageDeltaToCache) is already Zod-guarded throughparseWorkspaceRealtimeServerMessage, so it stays unchanged.Testing notes
pnpm check— pass.workspace-page-payload.test.tscover: valid payload returns the page, an added unknown field still parses, a missing top-level field returns null, and an item missing a required field returns null.pnpm testfor the workspaces feature — 291 pass.Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.