Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This fixes an issue where manually specifying
ssrMode: true
in thePowerSyncDatabase
constructorflags
could cause unexpected syncing behaviour to occur in the browser client.Previously the
WASQLiteOpenFactory
did not account for thessrMode
flag. This would create aDBAdapter
based on the detected environment. SpecifyingssrMode: true
would result in a functionalWASQLiteDBAdapter
being created (on the client).Previously the
SSRStreamingSyncImplementation
extendedAbstractStreamingSyncImplementation
which contains logic for processing sync commands from the server. Sync commands would be ano-op
if the suppledDBAdapter
was a placeholder SSR DBAdapter, but as described above this was not the case ifssrMode: true
was specified.The locks in
SSRStreamingSyncImplementation
are not exclusive, which could result in multiple clients processing sync commands into a single SQLite DB. This PR removes the ability forSSRStreamingSyncImplementation
to perform any actual syncing. This implementation is just meant to be a placeholder for cases where the PowerSyncDatabase client is accidentally used or exposed on the server.