datastore.add breaks if a record with an existing id is added

RESOLVED FIXED in Firefox 28

Status

()

defect
--
major
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jmcf, Assigned: baku)

Tracking

Trunk
1.3 C3/1.4 S3(31jan)
x86
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:1.3+, firefox27 wontfix, firefox28 fixed, firefox29 fixed, b2g-v1.3 fixed, b2g-v1.4 fixed)

Details

Attachments

(1 attachment)

This exception appears on the console, instead of reporting an error through the promise error function. 

E/GeckoConsole( 1817): [JavaScript Error: "aEvent.target is undefined" {file: "resource://gre/modules/DataStore.jsm" line: 39}]
Blocks: 950295
Posted patch add.patchSplinter Review
Attachment #8363641 - Flags: review?(ehsan)
Blocks: 916089
blocking-b2g: 1.3? → 1.3+
Comment on attachment 8363641 [details] [diff] [review]
add.patch

Review of attachment 8363641 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/datastore/DataStore.jsm
@@ -35,5 @@
>                                     "nsIMessageSender");
>  
>  /* Helper functions */
>  function createDOMError(aWindow, aEvent) {
> -  return new aWindow.DOMError(aEvent.target.error.name);

Oh, I see now that IndexedDBHelper.newTxn does this for us...  Sorry I didn't spot this in previous reviews.

::: dom/datastore/tests/file_duplicate.html
@@ +12,5 @@
> +  var gEvent;
> +  var gChangeId;
> +
> +  function is(a, b, msg) {
> +    alert((a === b ? 'OK' : 'KO') + ' ' + msg)

Nit: this can be:

function is(a, b, msg) {
  ok(a === b, msg);
}
Attachment #8363641 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/7095fa5eeb21
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.