Skip to content

(fix): pass dbName instead of key to setSyncEnabled in getSyncEnabled…#925

Merged
simolus3 merged 1 commit into
powersync-ja:mainfrom
johnnysedh3lllo:main
Apr 13, 2026
Merged

(fix): pass dbName instead of key to setSyncEnabled in getSyncEnabled…#925
simolus3 merged 1 commit into
powersync-ja:mainfrom
johnnysedh3lllo:main

Conversation

@johnnysedh3lllo

Copy link
Copy Markdown
Contributor

Bug

In getSyncEnabled, when no value exists in localStorage for the given key, the fallback call to setSyncEnabled incorrectly passes key (the already-prefixed string e.g. syncEnabled-example.db) instead of dbName. This causes setSyncEnabled to construct a double-prefixed key (syncEnabled-syncEnabled-example.db), creating a separate localStorage entry that is never read by getSyncEnabled.

Fix

Pass dbName instead of key to setSyncEnabled in the fallback branch.

Evidence

Two keys are created in localStorage instead of one when getSyncEnabled is called for the first time:

image
  • syncEnabled-example.db (correct)
  • syncEnabled-syncEnabled-example.db (erroneous duplicate)

@changeset-bot

changeset-bot Bot commented Apr 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: de128b7

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

@simolus3 simolus3 merged commit f6e0f95 into powersync-ja:main Apr 13, 2026
5 checks passed
@simolus3

Copy link
Copy Markdown
Contributor

Thank you!

@johnnysedh3lllo

Copy link
Copy Markdown
Contributor Author

Thank God and you're welcome. I'm glad i could.

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.

3 participants