Move bookmarks only moves the first bookmark with Async Places Transactions turned on

RESOLVED FIXED in Firefox 57

Status

()

Toolkit
Places
P1
normal
RESOLVED FIXED
9 months ago
9 months ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

Trunk
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

(Whiteboard: [fxsearch])

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

9 months ago
STR

1) Create some bookmarks
2) Open the Library window (cmd-shift-B)
3) Create a new folder
4) Select the bookmarks and then from the cog symbol, select "Move..."
5) Choose the new folder and select OK.

Actual Results

=> Only one item is moved

Expected Results

=> All selected items are moved.
(Assignee)

Comment 1

9 months ago
It also looks like after selecting OK, then bookmarking functions in the Library window are disabled.

I suspect this is caused by the dialog being closed and going out of scope whilst the async transactions are happening.
Comment hidden (mozreview-request)

Comment 3

9 months ago
mozreview-review
Comment on attachment 8904719 [details]
Bug 1396888 - Handle async moving of bookmarks in the caller for the move dialog, to avoid going out of scope whilst async actions are happening.

https://reviewboard.mozilla.org/r/176508/#review181738

::: browser/components/places/content/controller.js:800
(Diff revision 1)
> +    }
> +
> +    PlacesTransactions.batch(async () => {
> +      for (let node of this._view.selectedNodes) {
> +        // Nothing to do if the node is already under the selected folder.
> +        if (node.parent.itemId == args.moveToGuid)

comparing itemId with a guid?
Also, do we risk to have an empty batch due to this continue?

::: browser/components/places/content/controller.js:805
(Diff revision 1)
> +        if (node.parent.itemId == args.moveToGuid)
> +          continue;
> +        await PlacesTransactions.Move({ guid: node.bookmarkGuid,
> +                                        newParentGuid: args.moveToGuid }).transact();
> +      }
> +    }).catch(Components.utils.reportError);

let's make moveSelectedBookmarks async, and move the catch to the caller
Attachment #8904719 - Flags: review?(mak77)
Comment hidden (mozreview-request)

Comment 5

9 months ago
mozreview-review
Comment on attachment 8904719 [details]
Bug 1396888 - Handle async moving of bookmarks in the caller for the move dialog, to avoid going out of scope whilst async actions are happening.

https://reviewboard.mozilla.org/r/176508/#review181828
Attachment #8904719 - Flags: review?(mak77) → review+

Comment 6

9 months ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/80764c510b9b
Handle async moving of bookmarks in the caller for the move dialog, to avoid going out of scope whilst async actions are happening. r=mak

Comment 7

9 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/80764c510b9b
Status: ASSIGNED → RESOLVED
Last Resolved: 9 months ago
status-firefox57: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.