Skip to content

Conversation

@nathanstitt
Copy link

Fix a bug where useLiveQuery would return isLoading=false while data was still undefined for on-demand sync mode. This would frequently cause flicker of 'not found' type messages.

For example, I added a console.log of isLoading, data for a component I'm working on:

{data: undefined, queryLoading: false}
{data: undefined, queryLoading: false}
{data: Array(0), queryLoading: true}
{data: Array(1), queryLoading: false}

The useLiveQuery hook now subscribes to loadingSubset:change events and factors isLoadingSubset into the isLoading computation.

I'm not 100% sure this is the best approach to fixing this, but it seems like the best approach I could find given my relative lack of knowledge about the codebase. Happy to rework with any suggestions anyone has to resolve this.

🎯 Changes

✅ Checklist

the below do not exist but I've followed the spirt of them :)

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Fix a bug where useLiveQuery would return isLoading=false while data was
still undefined for on-demand sync mode. THis would frequently cause flicker of
'not found' type messages

The useLiveQuery hook now subscribes to loadingSubset:change events and factors
isLoadingSubset into the isLoading computation
@changeset-bot
Copy link

changeset-bot bot commented Dec 13, 2025

⚠️ No Changeset found

Latest commit: 1dc7c4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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