Closed Bug 423211 Opened 16 years ago Closed 16 years ago

Migration of SeaMonkey profile can fail when folder in source profile is missing

Categories

(SeaMonkey :: Startup & Profiles, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.0a1

People

(Reporter: Biesinger, Assigned: mcsmurf)

References

Details

Attachments

(1 file, 1 obsolete file)

On trunk/windows, importing bookmarks from a branch SeaMonkey does not seem to work, i.e. I get the default bookmarks.

I triggered the import by just running trunk SM for the first time, so I got asked to import.

File|Open bookmarks file seems to be a workaround.
Flags: blocking-seamonkey2.0a1?
I was able to import bookmarks from a 1.1 profile into a trunk profile on Linux.  I also tried with no existing trunk profiles and that also worked.
Version: unspecified → Trunk
Bug 432664 is a duplicate of this one. I could reproduce it. From my Comment to 432664 #1 

Last working Build is Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:1.9b3pre) Gecko/2008010102 SeaMonkey/2.0a1pre

Next windows Build is broken: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:1.9b3pre) Gecko/2008010203 SeaMonkey/2.0a1pre

Additional Info:
I guess the patch for Bug 386337 broke this (the only patch related to profile migration between this builds).

There was also a confirmation for this bug from a linux user 
Mozilla/5.0 (X11; U; Linux i686; rv:1.9.0.1pre) Gecko/2008070101 Mnenhy/0.7.5.20005 SeaMonkey/2.0a1pre

One of the Bugs should be duped and blocking seamonkey2.0a1 + - it's no fun for ppl. to test without bookmarks.
Marcus, in your source profile, do you have a "searchplugins" directory? If you don't, please could you try adding one and redoing the migration.

I bet http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp&rev=1.19&mark=648-653#640 is the problem (called from line 971) - if the source directory doesn't exist, then it returns a failure, that then causes CopyOtherData to abort, and in turn, causes other things not to happen because of the reported "failure".
OS: Windows XP → All
(In reply to comment #3)
> I bet
> http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp&rev=1.19&mark=648-653#640
> is the problem (called from line 971) - if the source directory doesn't exist,
> then it returns a failure, that then causes CopyOtherData to abort, and in
> turn, causes other things not to happen because of the reported "failure".

Interesting, so possibly fixes are:
1. ignore the return code of RecursiveCopy() as called from CopyOtherData()
2. move the CopyBookmarks line up a bit in nsSeamonkeyProfileMigrator::Migrate
   http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/suite/profile/migration/src/nsSeamonkeyProfileMigrator.cpp&rev=1.23&mark=107#102

I like option 2 better...
(In reply to comment #5)
> Interesting, so possibly fixes are:
> 1. ignore the return code of RecursiveCopy() as called from CopyOtherData()
> 2. move the CopyBookmarks line up a bit in nsSeamonkeyProfileMigrator::Migrate

Neither of which won't actually resolve the problem fully - in this case, RecursiveCopy is "incorrectly" returning a missing directory as a failure. We should either handle that specific case when we get the return code, or RecursiveCopy shouldn't return failure.

I haven't looked at where it is used to work out what we should do.

It'd still be nice if someone could actually test the theory as I haven't got time to at the moment.
In my Seamonkey profile directory, I have the following subdirectories:
  Cache
  chatzilla
  chrome
  Mail
  News

I added:
  searchplugins

I did a fresh profile migration with Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.9.0.2pre) Gecko/2008070613 SeaMonkey/2.0a1pre

Resulting profile has the following subdirectories:
  Cache
  chrome
  extensions
  Mail
  News

The bookmarks from the old profile are not present.  However, the Tools->Import in the bookmark manager found my old profile and successfully imported them.
(In reply to comment #3)
> Marcus, in your source profile, do you have a "searchplugins" directory? If you
> don't, please could you try adding one and redoing the migration.

No, the directory is missing in the old profile. 

Test with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/2008073000 SeaMonkey/2.0a1pre:
Without the searchplugins directory the bookmarks are missing, working when i create the [empty] directory.

I think a missing directory / file in the source profile shouldn't fail - you can't migrate what's missing.
Flags: blocking-seamonkey2.0a1? → blocking-seamonkey2.0a1+
Is Bug 452620 duplicate?
Assignee: general → nobody
Component: General → Startup & Profiles
QA Contact: general → profile-manager
Target Milestone: --- → seamonkey2.0alpha
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
Attachment #338211 - Flags: review?(bugzilla)
Comment on attachment 338211 [details] [diff] [review]
Patch

>+  if (NS_FAILED(rv))
>+    return rv;

That's usually (and should be) written as

NS_ENSURE_SUCCESS(rv, rv);
Attached patch Patch 2Splinter Review
Fixed a few occurrences of this right below the new code.
Attachment #338211 - Attachment is obsolete: true
Attachment #338282 - Flags: review?(neil)
Attachment #338211 - Flags: review?(bugzilla)
Comment on attachment 338282 [details] [diff] [review]
Patch 2

:)
Attachment #338282 - Flags: review?(neil) → review?(bugzilla)
Attachment #338282 - Flags: superreview+
Comment on attachment 338282 [details] [diff] [review]
Patch 2

I've got nothing against if (NS_FAILED(rv)) return rv; although it depends on how unusual failure is.
Attachment #338282 - Flags: review?(bugzilla) → review+
Pushed to comm-central, changeset 104de1a05154.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Summary: Importing bookmarks seems broken → Migration of SeaMonkey profile can fail when folder in source profile is missing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: