Closed Bug 412211 Opened 17 years ago Closed 17 years ago

fix downgrade code so that when downgrade from schema version 7+ back to 6+, we don't re-import bookmarks.html

Categories

(Firefox :: Bookmarks & History, defect, P1)

defect

Tracking

()

VERIFIED FIXED
Firefox 3 beta3

People

(Reporter: sspitzer, Assigned: dietrich)

References

Details

Attachments

(1 file)

fix downgrade code so that when downgrade from schema version 7+ back to 6+, we don't re-import bookmarks.html

spun off from bug #407296

here's why I think this is important to fix asap (I suggest before b3).

at some point, we will bump that schema version.

if it happens after b3, but before final, switching between builds (which is common)  will cause us problems, such as:  

1) data loss from re-importing bookmarks.html
2) browser.places.leftPaneFolderId pointing to a bogus id.

having .json backup will prevent this, but if we can avoid the forced import, we should, as it is also slow.

The fix for this will be in this code in nsNavHistory::InitDB()
 
653       // Downgrade v1,2,4,5
654       // v3,6 have no backwards incompatible changes.
655       if (DBSchemaVersion > 2) {
656         // perform downgrade to v2
657         rv = ForceMigrateBookmarksDB(mDBConn);
658         NS_ENSURE_SUCCESS(rv, rv);
659       }
Flags: blocking-firefox3?
Attached patch fixSplinter Review
Assignee: nobody → dietrich
Status: NEW → ASSIGNED
Attachment #296884 - Flags: review?(mano)
Comment on attachment 296884 [details] [diff] [review]
fix

r=sspitzer, assuming you tested by setting your version to 7 in places.sqlite and running your build.

thanks dietrich! 

seeking approval, we want this for sure.
Attachment #296884 - Flags: review?(mano)
Attachment #296884 - Flags: review+
Attachment #296884 - Flags: approval1.9?
Priority: -- → P1
Target Milestone: --- → Firefox 3 M11
Attachment #296884 - Flags: approval1.9? → approval1.9+
STR:

1. up schema to 7, create a profile, add a bookmark to toolbar
2. down schema to 6, run: notice the toolbar bookmark is gone, organizer is hosed

after applying the patch and following the same STR, bookmark is present, organizer is ok.
Checking in toolkit/components/places/src/nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v  <--  nsNavHistory.cpp
new revision: 1.226; previous revision: 1.225
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking-firefox3?
been bouncing all over with this profile no troubles Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090128 Shiretoko/3.1b3pre
Status: RESOLVED → VERIFIED
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: