Closed
Bug 1389717
Opened 8 years ago
Closed 8 years ago
Ensure `HistoryStore#changeItemID` waits for `fetchURLInfoForGuid`
Categories
(Firefox :: Sync, enhancement, P1)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
Firefox 57
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | unaffected |
| firefox56 | --- | wontfix |
| firefox57 | --- | fixed |
People
(Reporter: lina, Assigned: lina)
References
Details
Attachments
(1 file)
I caught this looking over our `PlacesSyncUtils` calls. Property access binds tighter than `await`, so `await PlacesSyncUtils.history.fetchURLInfoForGuid(oldID).url` won't wait for `fetchURLInfoForGuid`.
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Summary: Fix `await` operator precedence in `History#changeItemID` → Ensure `HistoryStore#changeItemID` waits for `fetchURLInfoForGuid`
| Assignee | ||
Updated•8 years ago
|
Attachment #8896529 -
Flags: review?(markh) → review?(tchiovoloni)
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8896529 [details]
Bug 1389717 - Ensure `HistoryStore#changeItemID` waits for `fetchURLInfoForGuid`.
https://reviewboard.mozilla.org/r/167794/#review172996
I don't think this function is called, but we should fix this either way. LGTM!
Attachment #8896529 -
Flags: review?(tchiovoloni) → review+
Comment 3•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8896529 [details]
Bug 1389717 - Ensure `HistoryStore#changeItemID` waits for `fetchURLInfoForGuid`.
https://reviewboard.mozilla.org/r/167794/#review173008
::: services/sync/modules/engines/history.js:163
(Diff revision 1)
> },
>
> async changeItemID(oldID, newID) {
> - this.setGUID(await PlacesSyncUtils.history.fetchURLInfoForGuid(oldID).url, newID);
> + let info = await PlacesSyncUtils.history.fetchURLInfoForGuid(oldID);
> + if (info) {
> + this.setGUID(info.url, newID);
I don't really mind, but I wonder if it might be better to have the code implicitly throw when info is falsey rather than silently do nothing?
Attachment #8896529 -
Flags: review+
| Comment hidden (mozreview-request) |
Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9d419fafe04f
Ensure `HistoryStore#changeItemID` waits for `fetchURLInfoForGuid`. r=markh,tcsc
Updated•8 years ago
|
Priority: -- → P1
Comment 6•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
| Assignee | ||
Comment 7•8 years ago
|
||
WONTFIXing for 56, since this function isn't ever called.
| Assignee | ||
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•