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

Resolve Issue 1765 (application hang if requireAuth: true in Dexie Cloud) #1766

Merged
merged 6 commits into from
Jul 16, 2023

Conversation

dfahlander
Copy link
Collaborator

No description provided.

The `db` passed to db.on.ready() callback must not block until db is ready because the callback's code is part of making the db ready. A bug prevented liveQueries based on the unblocked db to emit values before on-ready callback resolves its promise.

When using requireAuth: true, the entire authentication flow is done as a part of the on('ready') flow. A part of the flow was waiting for a liveQuery observable to emit currentUser value before continuing, leading to a deadlock.

There was a general bug that the "_vip" state of the db wasn't propagated to transactions and tables. This is solved by letting the "_vip" version of the db (the one passed to on-ready callback) be a Proxy that makes sure to return vipped tables and transactions so that all code using that db instance will not deadlock before the on-ready callback completes.
…to post an object with function properties.

Make sure not to post the DexieError but a simpler one, copying the message only.
…pified tables / transactions.

This will makes uses less complex, especially places where code is setting props on the vipified objects without having to get adjusted for the vip case.
@dfahlander dfahlander merged commit e96dd29 into master Jul 16, 2023
5 checks passed
@dfahlander dfahlander deleted the issue1765 branch July 16, 2023 10:09
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.

1 participant