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

Ensure session data is always returned #1412

Merged
merged 5 commits into from
Jan 14, 2025
Merged

Ensure session data is always returned #1412

merged 5 commits into from
Jan 14, 2025

Conversation

AlecAivazis
Copy link
Collaborator

@AlecAivazis AlecAivazis commented Jan 14, 2025

Fixes #1405

This PR fixes an issue with the transformation of the root layout if it included an early return. Previously the logic would look for a single value returned but now we look for any return in the function and ensure that the necessary values are included

cc @Rudedog9d

To help everyone out, please make sure your PR does the following:

  • Update the first line to point to the ticket that this PR fixes
  • Add a message that clearly describes the fix
  • If applicable, add a test that would fail without this fix
  • Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • Includes a changeset if your fix affects the user with pnpm changeset

Copy link

changeset-bot bot commented Jan 14, 2025

🦋 Changeset detected

Latest commit: 5e69c69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
houdini-svelte Patch
houdini-plugin-svelte-global-stores Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for houdini-docs-next canceled.

Name Link
🔨 Latest commit 5e69c69
🔍 Latest deploy log https://app.netlify.com/sites/houdini-docs-next/deploys/678625419da4090008d35518

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for houdinigraphql canceled.

Name Link
🔨 Latest commit 5e69c69
🔍 Latest deploy log https://app.netlify.com/sites/houdinigraphql/deploys/67862541fb20e50008d8d975

@Rudedog9d
Copy link

@AlecAivazis I was able to successfully test this against the test project from the original issue.

Steps for testing were:

# clone and setup houdini
git clone [email protected]:HoudiniGraphql/houdini.git
pnpm i

# build on main to replicate original issue
pnpm build

# install local houdini-svelte in test project
npm i ../houdini/packages/houdini-svelte/

# verify the server outputs "fetchParams session {}"
npm run dev

# checkout this branch
git checkout root-layout-load

# rebuild houdini-svelte - I used some extra options here because I was getting some issues with old code being cached
pnpm i && pnpm build --no-cache --force

# re-install local houdini-svelte in test project
npm i ../houdini/packages/houdini-svelte/

# verify the server outputs "fetchParams session { token: 'asdf' }"
npm run dev

I was able to successfully switch between main and this branch with expected results several times using this method 👍

@AlecAivazis
Copy link
Collaborator Author

Thanks for the detailed summary of the steps you took @Rudedog9d!

@AlecAivazis AlecAivazis merged commit c307841 into main Jan 14, 2025
15 checks passed
@AlecAivazis AlecAivazis deleted the root-layout-load branch January 14, 2025 19:09
@github-actions github-actions bot mentioned this pull request Jan 14, 2025
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.

Returning in top-level +layout.ts causes blank session data
2 participants