Skip to content

Conversation

stevensJourney
Copy link
Contributor

@stevensJourney stevensJourney commented Mar 5, 2024

Description

This fixes multiple issues regarding disconnecting and clearing the database.

This also updates the alpha-release branch with changes from master

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 to 0.7.0-alpha.2

Web

For web this fixes an issue where if calling disconnect(or disconnectAndClear) 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 then disconnectAndClear was called thereafter, the disconnectAndClear 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.

rkistner and others added 7 commits February 20, 2024 17:19
* feat(attachments): add error handlers

* fix: lint issue

* chore: version bump

* chore: pr reverts

* Update packages/powersync_attachments_helper/lib/src/attachments_queue_table.dart

Co-authored-by: stevensJourney <51082125+stevensJourney@users.noreply.github.com>

* Update demos/supabase-todolist/lib/attachments/queue.dart

Co-authored-by: stevensJourney <51082125+stevensJourney@users.noreply.github.com>

* chore: improve demo

* fix: image issue

---------

Co-authored-by: DominicGBauer <dominic@nomanini.com>
Co-authored-by: stevensJourney <51082125+stevensJourney@users.noreply.github.com>
@stevensJourney stevensJourney changed the base branch from master to alpha-release March 5, 2024 13:15
@stevensJourney stevensJourney marked this pull request as ready for review March 5, 2024 13:19
@stevensJourney stevensJourney requested a review from rkistner March 5, 2024 13:19
@stevensJourney stevensJourney requested a review from rkistner March 5, 2024 14:09
 - powersync@1.3.0-alpha.3
@stevensJourney stevensJourney force-pushed the alpha-fix-disconnect-and-clear branch from 1580f71 to c7e646b Compare March 5, 2024 14:43
@stevensJourney stevensJourney mentioned this pull request Mar 5, 2024
@stevensJourney stevensJourney merged commit c894b34 into alpha-release Mar 5, 2024
@stevensJourney stevensJourney deleted the alpha-fix-disconnect-and-clear branch March 5, 2024 14:59
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