Skip to content

Wait loop questions #436

Open
Open
@stelar7

Description

@stelar7

In Upgrading a database step 11 is supposed to wait for the transaction to finish.

A transaction is finished once it enters the finished state (after commit or abort)

Calling indexedDB.open("test", 1) will cause an upgrade, and then step 10.5 could change the state (via autocommit, or user action), but then we instantly set it back to inactive in step 10.6

  • Should step 11 instead be waiting for the task created in step 10 to finish? Or am I missing something here?

Given the following snippet:

let db;
const open_rq = indexedDB.open(undefined, 9);

open_rq.onupgradeneeded = function (e) {
    db = e.target.result;
};
    
open_rq.onsuccess = function (e) {
    db.close();
    let open_rq2 = indexedDB.open(db.name, 10);
};

Once we get to close a database connection step 3. we will be stuck in an infinite loop, because at no point has the transaction gone to the finished state. (The onupgradeneeded callback does nothing that would cause an abort or commit)

  • Is there a spec step im missing that handles this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions