Closed Bug 1309332 Opened 9 years ago Closed 9 years ago

Don't return a Places bookmark object from `PlacesSyncUtils.bookmarks.remove`

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: lina, Assigned: lina)

References

Details

Attachments

(1 obsolete file)

A tiny follow-up to bug 1295521: `PlacesSyncUtils.bookmarks.remove` still returns a Places bookmark instead of a Sync bookmark. I could change it so that it fetches the bookmark, converts it to a Places bookmark, then removes it, but that seems wasteful...especially since `PlacesUtils.bookmarks.remove` will fetch it yet again. Since we don't actually use the returned object for anything, it can log errors and return a Boolean.
Comment on attachment 8799908 [details] Bug 1309332 - Don't return a Places bookmark object from `PlacesSyncUtils.bookmarks.remove`. https://reviewboard.mozilla.org/r/84978/#review83532 ::: services/sync/modules/engines/bookmarks.js:685 (Diff revision 1) > > remove: function BStore_remove(record) { > - try { > - let info = Async.promiseSpinningly(PlacesSyncUtils.bookmarks.remove(record.id)); > + let wasRemoved = Async.promiseSpinningly(PlacesSyncUtils.bookmarks.remove(record.id)); > + if (wasRemoved) { > - if (info) { > - this._log.debug(`Removed item ${record.id} with type ${record.type}`); > + this._log.debug(`Removed item ${record.id} with type ${record.type}`); Won't type usually be `"item"` here? Remember `remove` is called with records where `r.deleted === true`.
Comment on attachment 8799908 [details] Bug 1309332 - Don't return a Places bookmark object from `PlacesSyncUtils.bookmarks.remove`. https://reviewboard.mozilla.org/r/84978/#review83532 > Won't type usually be `"item"` here? Remember `remove` is called with records where `r.deleted === true`. Ack, yes, you told me this before. :-) This log line isn't helpful, then. I guees fetch, convert, and delete is the right thing to do, then? Or we can leave it.
Comment on attachment 8799908 [details] Bug 1309332 - Don't return a Places bookmark object from `PlacesSyncUtils.bookmarks.remove`. Per IRC...Thom rewrote this function in bug 1299978, and the important methods already use sync IDs, so it's not worth it.
Attachment #8799908 - Attachment is obsolete: true
Attachment #8799908 - Flags: review?(tchiovoloni)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: