indexeddb: abort pending worker upgrade and delete new db on rollback#42998
Conversation
|
🔨 Triggering try run (#22632427432) for Linux (WPT) |
|
Test results for linux-wpt from try job (#22632427432): Flaky unexpected result (30)
Stable unexpected results that are known to be intermittent (18)
Stable unexpected results (1)
|
|
|
|
🔨 Triggering try run (#22634334160) for Linux (WPT) |
|
Test results for linux-wpt from try job (#22634334160): Flaky unexpected result (29)
Stable unexpected results that are known to be intermittent (16)
|
|
✨ Try run (#22634334160) succeeded. |
gterzian
left a comment
There was a problem hiding this comment.
LGTM with a note to address.
| // IndexedDB §5.8 Step 3: "or 0 (zero) if database was newly created." | ||
| // IndexedDB §5.8 Step 4: "or the empty set if database was newly created." | ||
| if let Some(db) = self.databases.remove(&key) { | ||
| let _ = db.delete_database(); |
| // Invariant: aborted initial upgrades must not remain as version-0 databases. | ||
| self.databases.remove(&key); | ||
| // IndexedDB §5.8 Step 3: "or 0 (zero) if database was newly created." | ||
| // IndexedDB §5.8 Step 4: "or the empty set if database was newly created." |
There was a problem hiding this comment.
So the spec says to set the objects stores to the empty set, why are we deleting the database here? Please add a note explaining.
There was a problem hiding this comment.
Sorry for late comment, but @gterzian asked a very good question. The spec doesn't suggest to delete the database. I checked at least Firefox and it leaves sqlite database on disk.
There was a problem hiding this comment.
Safari seems to leave the database as well (at least according to its dev tools). However, the database doesn't show up in dev tools in Chrome (after aborting the version change transaction). This might be worth filing a spec issue to clarify behavior?
There was a problem hiding this comment.
I deleted it initially because I took a too strong interpretation of rollback(I thought make sense), I was trying to guarantee “initial upgrade abort behaves like pre creation state” (version 0, no stores, and no entry in indexedDB.databases()), and since Servo creates the SQLite DB at open, deleting the DB directory was the simplest way to force that state, I will undo this and created spec issue.
…#42998) Abort pending upgrade requests when a worker closes, correctly roll back newlyy created databases by deleting backend state on old_version == 0. Testing: IndexedDB/worker-termination-aborts-upgrade.window.js.ini test pass. part of #40983 --------- Signed-off-by: Taym Haddadi <[email protected]>
Signed-off-by: Taym Haddadi <[email protected]>
0181d24 to
65145f4
Compare
|
@Taym95 It's the same two IDB tests failing in every merge attempt. What are you hoping will happen? |
I am confused used to pass, I will have another look today |
Signed-off-by: Taym Haddadi <[email protected]>
65145f4 to
f22c5d7
Compare
Abort pending upgrade requests when a worker closes, correctly roll back newlyy created databases by deleting backend state on old_version == 0.
Testing: IndexedDB/worker-termination-aborts-upgrade.window.js.ini test pass.
part of #40983