Skip to content

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

Open
@justinbhopper

Description

@justinbhopper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions