[Alpha Fix] Disconnect and clear bug #66
Merged
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.
Description
This fixes multiple issues regarding disconnecting and clearing the database.
This also updates the
alpha-release
branch with changes frommaster
Native
For native platforms this fixes an issue where after calling
disconnect
the PowerSync client would fail to re-establish a valid streaming connection.This is fixed by updating
sqlite_async
to0.7.0-alpha.2
Web
For web this fixes an issue where if calling
disconnect
(ordisconnectAndClear
) multiple times, the abort controller was not cleared, which would attempt to abort twice - which throws an exception.If
disconnect
was called first, say from an authentication provider listener such as in here thendisconnectAndClear
was called thereafter, thedisconnectAndClear
function would throw an exception before actually clearing the database.This PR properly aborts the web streaming sync connection and awaits for the abort process to complete.