Skip to content

Conversation

stevensJourney
Copy link
Collaborator

@stevensJourney stevensJourney commented Sep 9, 2025

Overview

This PR fixes several bugs and regressions introduced with Incrementally Watched Queries.

For background, see this Discord thread.

Updating Watched Query Settings

This addresses a race condition that could occur when updateSettings was called multiple times on the same WatchedQuery instance.
The changes improve how AbortController lifecycles are managed, ensuring that updates from linked queries do not execute simultaneously.

Previously, this could cause isFetching to briefly report false before toggling back to true when query parameters changed.

React Hooks

In some cases, isFetching was reported as false immediately after changing query parameters: before the query had actually executed. This made handling state in useQuery unreliable.

This PR fixes the issue by applying the same approach that was previously implemented here.

Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: 8d9d158

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

This PR includes changesets to release 9 packages
Name Type
@powersync/common Patch
@powersync/react Patch
@powersync/adapter-sql-js Patch
@powersync/node Patch
@powersync/op-sqlite Patch
@powersync/react-native Patch
@powersync/tanstack-react-query Patch
@powersync/web Patch
@powersync/diagnostics-app 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

@stevensJourney stevensJourney changed the title [Test] Watched Query updateSettings race WatchedQuery Bug Fixes Sep 15, 2025
@stevensJourney stevensJourney marked this pull request as ready for review September 15, 2025 11:10
@stevensJourney stevensJourney merged commit a0ee132 into main Sep 17, 2025
9 checks passed
@stevensJourney stevensJourney deleted the watch_test branch September 17, 2025 07:29
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.

2 participants