Closed Bug 1523665 Opened 5 years ago Closed 5 years ago

Bookmarks.insertTree should take account of invalid bookmark info causing an insertion of zero items

Categories

(Toolkit :: Places, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox-esr60 --- wontfix
firefox65 --- wontfix
firefox66 --- fixed
firefox67 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Whiteboard: [qa-66b-p2])

Attachments

(1 file)

In bug 1523096 we have seen that it is possible for insertTree to be called for a root, but to filter out all items to be inserted (as they are invalid), and as a result, it attempts to insert with an empty array.

This causes sqlite to fail, and for example import transactions to abort.

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ba41803aea53
Bookmarks.insertTree should take account of invalid bookmark info causing an insertion of zero items. r=mak
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Can we uplift this?

Flags: needinfo?(standard8)

Comment on attachment 9039848 [details]
Bug 1523665 - Bookmarks.insertTree should take account of invalid bookmark info causing an insertion of zero items. r?mak

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

Bookmarks Async APIs

User impact if declined

Users importing bookmarks (or restoring from backups), may have incomplete restoration and warnings that the restore failed. Whilst we attempt to filter out invalid records, if the filtering leads to adding nothing to a top-level folder, then the restore will fail.

Is this code covered by automated tests?

Yes

Has the fix been verified in Nightly?

No

Needs manual test from QE?

No

If yes, steps to reproduce

List of other uplifts needed

None

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

Simple patch to skip attempting to insert records when there are no records to insert.

String changes made/needed

None

Flags: needinfo?(standard8)
Attachment #9039848 - Flags: approval-mozilla-beta?

When did the regression start? With 64?

Flags: needinfo?(standard8)

(In reply to Liz Henry (:lizzard) (use needinfo) from comment #6)

When did the regression start? With 64?

I think if anything it probably started with bug 1095426 in 56... however you could reproduce similar bugs depending on the exact corruption from before then. We've already fixed bugs handling bad types or bad urls (bug 1373610/bug 1425764), this is the latest step in improving corruption/unexpected formats for handling for backups.

Flags: needinfo?(standard8)

Comment on attachment 9039848 [details]
Bug 1523665 - Bookmarks.insertTree should take account of invalid bookmark info causing an insertion of zero items. r?mak

Fix for some cases of corrupt data; adds tests.
OK to uplift for beta 4.

Attachment #9039848 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Whiteboard: [qa-66b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: