Closed Bug 1211370 Opened 9 years ago Closed 9 years ago

Get "task.target is undefined" error when deleting a history record from Places DataStore.

Categories

(Firefox OS Graveyard :: Gaia::Browser, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1216394
FxOS-S11 (13Nov)

People

(Reporter: selee, Assigned: selee)

References

Details

(Whiteboard: [systemsfe])

When the places record is removed from Places DataStore, the following error will popup:
JavaScript error: app://search.gaiamobile.org/shared/js/sync_datastore.js, line 89: TypeError: task.target is undefined

https://github.com/mozilla-b2g/gaia/blob/master/shared/js/sync_datastore.js#L89

after checking MDN DataStoreTask object, there is no 'target' property.
https://developer.mozilla.org/en-US/docs/Web/API/DataStoreTask
could someone give me a hint or direction how to fix it?
Hi Dale, Ben,

Per the bug description, it will fail to remove a place record.
Could you help to see this bug? This bug will affect the history synchronization feature.
Thank you. :)
Flags: needinfo?(dale)
Flags: needinfo?(bfrancis)
Whiteboard: [systemsfe]
Target Milestone: --- → FxOS-S9 (16Oct)
Sean, hey yup this is just using an old version of the datastore api and as it is a currently unused code path it never got updated, if you just change it to:

          case 'remove':
            var id = task.id;
            SDS.persistStore.remove(id, SDS.store.revisionId);

Then it should be fine, thanks
Flags: needinfo?(dale)
Flags: needinfo?(bfrancis)
After apply Dale's suggestion, another error happens at [1]:
JavaScript error: app://search.gaiamobile.org/js/places_idb.js, line 88: TypeError: txn.objectStore(...).remove is not a function

[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/search/js/places_idb.js#L88
Target Milestone: FxOS-S9 (16Oct) → FxOS-S11 (13Nov)
Assignee: nobody → selee
Priority: -- → P1
After verifying the patch at bug 1216394, it does fix the issue.
Status: NEW → RESOLVED
Closed: 9 years ago
Depends on: 1216394
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.