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

Calling SQLite.enablePromise(true) multiple times corrupts the library #580

Open
justinbhopper opened this issue Sep 19, 2024 · 0 comments

Comments

@justinbhopper
Copy link

Expected Behavior

Calling SQLite.enablePromise(true) after its already been called should result in a no-op.

Current Behavior

Calling SQLite.enablePromise(true) more than once will break the library.

Possible Solution

Calling SQLite.enablePromise(true) multiple times will corrupt the library, causing errors such as RangeError: Maximum call stack size exceeded.

The way this method is written, it rewires the methods on the exported SQLite class from callback-based to promise-based. It does not have any safety check for whether this operation has previously already occurred, so the operation ends up rewiring methods a second time, breaking them entirely.

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

No branches or pull requests

1 participant