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

Commits on Jul 15, 2023

  1. Resolves #1765

    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.
    dfahlander committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    1f7c33e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad21ff9 View commit details
    Browse the repository at this point in the history
  3. When error occur, a consequential error happened: postMessage failed …

    …to post an object with function properties.
    
    Make sure not to post the DexieError but a simpler one, copying the message only.
    dfahlander committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    a64ef87 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9e49a5b View commit details
    Browse the repository at this point in the history
  5. One unit test fails. Must use Proxy instead of Object.create() for vi…

    …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 committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    b75d6ac View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1899292 View commit details
    Browse the repository at this point in the history