Skip to content
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

[Fix] Double rollback calls in transactions #222

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

Chriztiaan
Copy link
Contributor

Users can easily trigger two rollback calls in transactions which causes an exception message users can't do anything about. This PR simply silences the exception when this happens as we do in dart. Applies powersync-ja/react-native-quick-sqlite#36 here for react-native package.

Example:

PowerSync.writeTransaction<void>(async (trx) => {
  try {
   throw 'x';
  } catch(ex) {
    trx.rollback(); // explicit
    throw ex; // causes rollback call in wrapper
  }
})

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: cf4bf1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@powersync/web Patch
@powersync/react-native Patch
angular-supabase-todolist Patch
example-capacitor Patch
example-electron Patch
example-nextjs Patch
example-vite Patch
react-multi-client Patch
react-supabase-todolist Patch
vue-supabase-todolist Patch
yjs-react-supabase-text-collab Patch
diagnostics-app Patch
django-react-native-todolist Patch
react-native-supabase-group-chat Patch
react-native-supabase-todolist Patch

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

@Chriztiaan Chriztiaan requested a review from rkistner July 10, 2024 11:07
@Chriztiaan Chriztiaan marked this pull request as ready for review July 10, 2024 11:08
@Chriztiaan Chriztiaan merged commit 8d5b702 into main Jul 11, 2024
2 checks passed
@Chriztiaan Chriztiaan deleted the bug/double-rollback branch July 11, 2024 07:10
@Chriztiaan Chriztiaan restored the bug/double-rollback branch July 11, 2024 07:11
@Chriztiaan Chriztiaan deleted the bug/double-rollback branch July 11, 2024 07:11
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.

None yet

2 participants