Closed
Bug 1273833
Opened 9 years ago
Closed 9 years ago
Fix failure of idbobjectstore_createIndex7-event_order.htm in web-platform test.
Categories
(Core :: Storage: IndexedDB, defect)
Core
Storage: IndexedDB
Tracking
()
RESOLVED
FIXED
mozilla50
| Tracking | Status | |
|---|---|---|
| firefox50 | --- | fixed |
People
(Reporter: bevis, Assigned: bevis)
References
Details
(Whiteboard: [tw-dom] btpp-active)
Attachments
(1 file, 1 obsolete file)
For createIndex6:
"rq_add1.success",
"rq_add2.success",
"rq_add3.error: AbortError",
"transaction.error: AbortError",
"db.error: AbortError",
"transaction.abort: AbortError", <-- "ConstraintError" is expected
"db.abort: AbortError", <-- "ConstraintError" is expected
"open_rq.error: ConstraintError" <-- "AbortError" is expected
For createIndex7:
"rq_add1.success",
"rq_add2.error: ConstraintError",
"transaction.error: ConstraintError",
"db.error: ConstraintError",
"rq_add3.error: AbortError",
"transaction.error: AbortError",
"db.error: AbortError",
"transaction.abort: ConstraintError",
"db.abort: ConstraintError",
"open_rq.error: ConstraintError" <-- "AbortError" is expected
| Assignee | ||
Comment 1•9 years ago
|
||
There are 2 issues in this bug:
1. open_rq.error shall always be set to AbortError if version change transaction is aborted [1]:
"
3.3.1 Opening a database:
8. If db's version is less than version, run these substeps:
3. If the upgrade transaction was aborted, run the steps for closing a database connection with
connection, create and return a new AbortError exception and abort these steps.
"
2. In createIndex6, the transaction.error was set to AbortError earlier by rq_add3.error in [2] instead of ConstraintError by [3], which doesn't comply to the requirement mentioned in [4]:
"
once the implementation determines that creating the index has failed, it MUST abort the transaction using the steps for aborting a transaction using an appropriate error as error. For example if creating the index failed due to quota reasons, QuotaExceededError MUST be used as error and if the index can't be created due to unique flag constraints, ConstraintError MUST be used as error.
"
For issue#1, it shall be fine to set the |openDatabaseOp->mResultCode| to NS_ERROR_DOM_INDEXEDDB_ABORT_ERR in VersionChangeTransaction::SendCompleteNotification().
However,
for issue#2, need to figure out whether the transaction.error shall be set by rq_add3 in this use case.
[1] http://w3c.github.io/IndexedDB/#opening
[2] https://hg.mozilla.org/mozilla-central/annotate/f3f2fa1d7eed5a8262f6401ef18ff8117a3ce43e/dom/indexedDB/IDBTransaction.cpp#l656
[3] https://hg.mozilla.org/mozilla-central/annotate/f3f2fa1d7eed5a8262f6401ef18ff8117a3ce43e/dom/indexedDB/IDBTransaction.cpp#l804
[4] http://w3c.github.io/IndexedDB/#dom-idbobjectstore-createindex
| Assignee | ||
Comment 2•9 years ago
|
||
idbobjectstore_createIndex6-event_order.htm will be addressed in bug 1274161 instead due to different root cause.
Summary: Fix failure of idbobjectstore_createIndex(6|7)-event_order.htm in web-platform test. → Fix failure of idbobjectstore_createIndex7-event_order.htm in web-platform test.
| Assignee | ||
Comment 3•9 years ago
|
||
| Assignee | ||
Comment 4•9 years ago
|
||
|AbortError| is the only reason of IDBOpenRequest.onerror if the version change transaction is aborted according to |3.3.1 Opening a database| in [1].
To meet this requirement, the openDatabaseOp->mResultCode has to be set to AbortError in VersionChangeTransaction::SendCompleteNotification() if failed.
In addition, please be aware that, in test_temporary_storage.js, there are 2 possible error name in IDBOpenRequest.onerror:
1. AbortError: if VersionChangeTransaction is failed at DatabaseConnection::CommitWriteTransaction while commiting the result of VersionChangeTransaction.
2. QuotaExceededError: if IDBOpenRequest is failed at earlier stage at OpenDatabaseOp::DoDatabaseWork() while CreateStorageConnection() before running into State::BeginVersionChange.
[1] http://w3c.github.io/IndexedDB/#opening
Attachment #8754340 -
Flags: review?(khuey)
| Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8754340 [details] [diff] [review]
(v1) Patch: Always return AbortError of the Open DB Request if the Upgrade Transaction is Aborted.
cancel the review because test_error_events_abort_transactions.html has to be modified accordingly as well.
Attachment #8754340 -
Flags: review?(khuey)
| Assignee | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 6•9 years ago
|
||
1. The detailed reason of this fix was explained at comment 4.
2. Fix the failure in error_events_abort_transactions_iframe.html accordingly.
Attachment #8754340 -
Attachment is obsolete: true
Attachment #8755708 -
Flags: review?(khuey)
| Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8754340 [details] [diff] [review]
(v1) Patch: Always return AbortError of the Open DB Request if the Upgrade Transaction is Aborted.
Resume the review.
The reason of this change is explained in comment 4.
Attachment #8754340 -
Flags: review?(khuey)
| Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8754340 [details] [diff] [review]
(v1) Patch: Always return AbortError of the Open DB Request if the Upgrade Transaction is Aborted.
sorry. resume the wrong one.
Attachment #8754340 -
Flags: review?(khuey)
| Assignee | ||
Updated•9 years ago
|
Attachment #8755708 -
Attachment description: (v2) Patch: Always return AbortError of the Open DB Request if the Upgrade Transaction is Aborted. → (v2) Patch: Always return AbortError in IDBOpenRequest if the Upgrade Transaction is Aborted.
| Assignee | ||
Updated•9 years ago
|
Attachment #8755708 -
Attachment description: (v2) Patch: Always return AbortError in IDBOpenRequest if the Upgrade Transaction is Aborted. → (v2) Patch: Always return AbortError in IDBOpenRequest.onerror if the Upgrade Transaction is Aborted.
Attachment #8755708 -
Flags: review?(khuey) → review+
| Assignee | ||
Comment 9•9 years ago
|
||
| Assignee | ||
Comment 10•9 years ago
|
||
Treeherder result in comment 9 looks fine.
Keywords: checkin-needed
Comment 11•9 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d0f169cdd9d1
Always return AbortError of the Open DB Request if the Upgrade Transaction is aborted. r=khuey
Keywords: checkin-needed
Comment 12•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•