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

Dexie Cloud: hanging indefenitely with {requireAuth: true} option #1765

Closed
dfahlander opened this issue Jul 15, 2023 · 0 comments
Closed

Dexie Cloud: hanging indefenitely with {requireAuth: true} option #1765

dfahlander opened this issue Jul 15, 2023 · 0 comments
Labels

Comments

@dfahlander
Copy link
Collaborator

Latest version of dexie-cloud-addon and dexie@next hangs indefenitely when having the option {requireAuth: true} to db.cloud.options().

@dfahlander dfahlander added the bug label Jul 15, 2023
dfahlander added a commit that referenced this issue Jul 15, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant