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

Added fix for IndexDB version not incrementing due to parallal execution of sql statements #1721

Merged
merged 8 commits into from
Jun 12, 2023

Conversation

Julias0
Copy link
Contributor

@Julias0 Julias0 commented Jun 11, 2023

Fix for #1641

Inside 91indexeddb.js,

const request = indexedDB.open(ixdbid, found.version + 1);

Since PromiseAll triggers all of the statements at the same time, it causes version to get incremented only once even if multiple DDL statements are present. Have modified the behaviour to execute the queries sequentially which will prevent race conditions such as these from coming up

@mathiasrw
Copy link
Member

mathiasrw commented Jun 12, 2023

This is such a good point. Thank you!

Any chance you can think about how we add a few tests for this?

@Julias0
Copy link
Contributor Author

Julias0 commented Jun 12, 2023

This is such a good point. Thank you!

Any chance you can think about how we add a few tests for this?

Have added a new test to check this scenario @mathiasrw Lemme know if it works.

@mathiasrw
Copy link
Member

I really like how precise you nailed this problem.

@mathiasrw mathiasrw merged commit 9018bef into AlaSQL:develop Jun 12, 2023
@mathiasrw
Copy link
Member

Released as part of v4.0.5

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.

2 participants