Closed Bug 470429 Opened 16 years ago Closed 16 years ago

nsPlacesDBFlush::onItemAdded should not sync if the item is a container

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: mak, Assigned: mak)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 3 obsolete files)

we are doing more work than needed, onItemAdded should sync places only if we create an uri item, containers don't use moz_places table
Attached patch patch (obsolete) — Splinter Review
apart this, i was thinking that if we are in a batch we should not sync onItemAdded and onItemChanged... but i fear that could cause issues for longer batches, so for now i'm not doing that.
Attachment #353974 - Flags: review?(sdwilsh)
Attached patch patch v1.1 (obsolete) — Splinter Review
a minor style coherence nit
Attachment #353974 - Attachment is obsolete: true
Attachment #353975 - Flags: review?(sdwilsh)
Attachment #353974 - Flags: review?(sdwilsh)
(In reply to comment #1)
> Created an attachment (id=353974) [details]
> patch
> 
> apart this, i was thinking that if we are in a batch we should not sync
> onItemAdded and onItemChanged... but i fear that could cause issues for longer
> batches, so for now i'm not doing that.
How would that cause issues for longer batches?  We don't want to do any syncing during batches right?
(In reply to comment #3)
> (In reply to comment #1)
> How would that cause issues for longer batches?  We don't want to do any
> syncing during batches right?

if we crash in the middle of a batch, we could end up with lot of orphan bookmarks. suppose that the batch is an undo of the deletion of 100 bookmarks, hwv i think for that could make sense go with a followup
(In reply to comment #4)
> if we crash in the middle of a batch, we could end up with lot of orphan
> bookmarks. suppose that the batch is an undo of the deletion of 100 bookmarks,
> hwv i think for that could make sense go with a followup
And we should be doing that from within a transaction, so if we crash, sqlite will roll that back when we next open the database.
Attached patch patch v2 (obsolete) — Splinter Review
ok, i'm sold
Attachment #353975 - Attachment is obsolete: true
Attachment #354134 - Flags: review?(sdwilsh)
Attachment #353975 - Flags: review?(sdwilsh)
Comment on attachment 354134 [details] [diff] [review]
patch v2

r=sdwilsh
Attachment #354134 - Flags: review?(sdwilsh) → review+
test_history_removeAllPages.js needs to be fixed contextually to this push since it relies on sync count
Attached patch patch v2.1Splinter Review
additional test fix, ready to land
Attachment #354134 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/c4785f2136df
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.9.1 → mozilla1.9.2a1
Attachment #355780 - Flags: approval1.9.1?
Comment on attachment 355780 [details] [diff] [review]
patch v2.1

Low risk; small scope - reduces the number of times we sync to disk
Flags: in-testsuite+
Attachment #355780 - Flags: approval1.9.1? → approval1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: