-
Notifications
You must be signed in to change notification settings - Fork 60
Remove Old Mutex #662
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
Remove Old Mutex #662
Conversation
🦋 Changeset detectedLatest commit: 88fbaf8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
|
What was affected by this? |
|
The only affect I can think of is in the Node.js SDK: calls to |
Overview
The very first version of the JS SDK used a shared mutex instance for read and write locks. Future versions moved the locking to the
DBAdapterinterface.The
AbstractPowerSyncDatabasestill contained the shared mutex code which was used in the commonreadLockandwriteLockimplementations.Using the same mutex for
readLockandwriteLockbreaks concurrency. The React native SDK had an override for thereadLockandwriteLockmethod which avoided this issue. Web only has a single connection, so concurrency wasn't an issue there. The Node.js SDK however would rely on the common implementation and would therefore have some concurrency issues. Luckily the individualget,getAllandgetOptionalmethods go through theDBAdapterand not thereadLockAPI. Currency was only partially broken for the Node.js SDK.This PR removes the old mutex entirely.