Skip to content

session refresh queries - #1723

Merged
AlecAivazis merged 5 commits into
mainfrom
707-session-refresh-queries
Jul 14, 2026
Merged

session refresh queries#1723
AlecAivazis merged 5 commits into
mainfrom
707-session-refresh-queries

Conversation

@siddarthvader

Copy link
Copy Markdown
Collaborator

Fixes #1225

Changes in houdini session will trigger all queries to refetch. When __houdini_session__ is changed because of external factors or anyhow, we already watch page.data for setting client session but now we also deep compare the old _houdini__session_ with latest one,if it has changes we will refresh all the queries with new session

The cache refetch message can now carry a session value. Query refetches use that value when present instead of falling back to the query's last session, which prevents session-change refreshes from refetching with

export type CacheMessage<_Data = any> =
	| {
			kind: 'update'
			data: _Data
	  }
	| {
			kind: 'refetch'
			session?: App.Session | null // added new
	  }

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

when houdini session is changed because of external refactors, we
already page.data for setting client session but now we also deep
compare the old _houdini__session_ with latest one, if it has changes we
willl refresh all the queries with new session
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73cc67f

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

This PR includes changesets to release 3 packages
Name Type
houdini-svelte Patch
houdini-core Patch
houdini 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

Comment thread packages/houdini/src/runtime/cache/subscription.ts Outdated
}
| {
kind: 'refetch'
session?: App.Session | null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should also add metadata and the other extra args from the fetch functino

Comment thread packages/houdini-svelte/package/vite/transform/session.test.ts
@AlecAivazis
AlecAivazis merged commit dfae5a3 into main Jul 14, 2026
16 checks passed
@AlecAivazis
AlecAivazis deleted the 707-session-refresh-queries branch July 14, 2026 04:01
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.

Changing session should refresh queries

2 participants