IDBFactory.deleteDatabase(): result is undefined, not null - #45719
Merged
Merged
Conversation
Contributor
|
Preview URLs (1 page) |
Collaborator
|
Interesting, it looks like the non-normative bit of the spec is wrong:
|
Contributor
Author
|
Yes, that sentence is from the "For web developers" box ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the result value documented on the
IDBFactory.deleteDatabase()page:resultisnullafter a successful deletion. It isundefined. The page's own "Description" section already saysundefined, so the page contradicted itself.event.result. Thesuccessevent here is anIDBVersionChangeEvent, which has noresultproperty, so the line printedundefinedfor the wrong reason. It now logsdbDeleteRequest.result.Motivation
The spec sets the result to
undefined. IndexedDB 3.0, §4.3 The IDBFactory interface,deleteDatabase(name)steps:All three engines do the same:
IDBOpenDBRequest::onDeleteDatabaseSuccess()callssetResultToUndefined()(Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp).BackgroundFactoryRequestChild::HandleResponse(const DeleteDatabaseRequestResponse&)passesJS::UndefinedHandleValueas the result (dom/indexedDB/ActorsChild.cpp).How I tested
I wrote a test page that opens a database (version 3), closes it, deletes it, and then deletes a database that doesn't exist. In each
successhandler it logs the request'sresult. Output in Edge 153 (Chromium, headless):markdownlint-cli2,prettier --check, andcspell(with.vscode/cspell.json) all pass on the changed file.Related issues and pull requests
The page's other gaps (the
blockedstate) were covered in #44350 for #42779.