Fix error codes for {create,delete}{ObjectStore,Index}

RESOLVED FIXED in Firefox 41

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

Tracking

({dev-doc-complete})

Trunk
mozilla41
Points:
---

Firefox Tracking Flags

(firefox40 affected, firefox41 fixed)

Details

Attachments

(1 attachment)

Updated

4 years ago
Attachment #8624619 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/2fd35e488c72
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Comment on attachment 8624619 [details] [diff] [review]
Patch, v1

Approval Request Comment
[Feature/regressing bug #]: This behavior is very old
[User impact if declined]: Wrong error codes thrown in certain edge cases
[Describe test coverage new/current, TreeHerder]: WPT tests
[Risks and why]: Extremely low risk, just changes the error codes returned.
[String/UUID change made/needed]: None
Attachment #8624619 - Flags: approval-mozilla-aurora?
> [Feature/regressing bug #]: This behavior is very old
Ben, why do you think we should take it now?

> [User impact if declined]: Wrong error codes thrown in certain edge cases
What is the impact for users? (I don't know much about IndexedDB)
Flags: needinfo?(bent.mozilla)
This isn't really a user problem, it's a web developer problem. Without this patch they can't distinguish between two different error cases. Not a big deal, but the patch is also very simple.
Flags: needinfo?(bent.mozilla)
OK, does this need the documentation to be updated?
Flags: needinfo?(bent.mozilla)
Attachment #8624619 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(In reply to Sylvestre Ledru [:sylvestre] from comment #6)
> OK, does this need the documentation to be updated?

Ah, looks like it does. Thanks.
Flags: needinfo?(bent.mozilla)
Keywords: dev-doc-needed
Needs rebasing for Aurora uplift.
Flags: needinfo?(bent.mozilla)
Comment on attachment 8624619 [details] [diff] [review]
Patch, v1

This missed the uplift. Please request Beta approval on the rebased patch once it's ready.
Attachment #8624619 - Flags: approval-mozilla-aurora+
Hi there,

Could someone just confirm which methods of IDBIndex and IDBOBjectStore this applies to, and what the change is exactly? most of the likely methods list both InvalidStateError and TransactionInactiveError, for example

https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/add

But I guess the descriptions of when those errors are thrown just need updating?
IDBDatabase::CreateObjectStore and IDBDatabase::DeleteObjectStore
- used to throw InvalidStateError only
- it now throws TransactionInactiveError if the "versionchange" transaction is not active

IDBObjectStore::CreateIndex, IDBObjectStore::DeleteIndex
- used to throw InvalidStateError only
- it now throws TransactionInactiveError if the transaction this IDBObjectStore belongs to is not active
Flags: needinfo?(bent.mozilla)
Thanks Jan - this is really helpful! I have updated the error descriptions on these methods as follows:

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore
https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/deleteObjectStore
https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex
https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/deleteIndex

Let me know if these sound ok. 

(the first one is currently wrong; I've edited the content, but it is refusing to update the display and still coming up with the old content because of an annoying bug; should be fixed soon.)
You need to log in before you can comment on or make changes to this bug.