Closed
Bug 192124
Opened 22 years ago
Closed 22 years ago
Filing more than one bookmark in a newly created folder cause bookmarks not to be saved
Categories
(SeaMonkey :: Bookmarks & History, defect, P1)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.3final
People
(Reporter: rija, Assigned: janv)
References
Details
(Keywords: dataloss, Whiteboard: [adt1] fixed1.3)
Attachments
(1 file)
707 bytes,
patch
|
sdagley
:
review+
peterv
:
superreview+
asa
:
approval1.3+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030205 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030205 Filing more than one bookmark in a newly created folder cause bookmarks (all or all except the first one) not to be saved after quiting (normally, without crashing) the application. If the folder has been created in previous session, adding several bookmarks in that folder during the same session is OK. It' s also OK when adding bookmark directly in the "root" without creating folder. Reproducible: Always Steps to Reproduce: 1. add a bookmark with "File bookmark..." 2. Create a new folder in the dialog, select it then valid 3. within the same session file other bookmarks in the same folder 4. Quit Mozilla 5. Relaunch Mozilla Actual Results: Most time: Only the first filed bookmark (the one for wich we created the folder) is present in the folder Sometimes: the folder is here but there's no bookmark at all inside Expected Results: the folder should contain all filed bookmarks bug reproduced on 2 computers: IBook 600 with MacOSX 10.2.3 Dual G4/450 with MacOSX 10.2.3 (I'm on HFS+ filesystem and the Journaling is OFF) with the MachO version of Mozilla : 2003013103 2003020303 2003020503 My bookmarks.html is big (216k) but the problem occured on a brand new profile too. The sites I tried to add are not already in my bookmarks and the name for the folder are different from existing ones and contains no spaces ( I used dummy names like 'test', 'demo', etc for testing) The problem also occured when bookmarks (except the first one) are dragged from the url bar to the folder into the Bookmark view of the sidebar And it happens when the application is quitting correctly
Probably a dup of bug 192011.
Reporter | ||
Comment 3•22 years ago
|
||
There are chances that the problem is the same as for 192011. But in this case the description of 192011 does not reflect the data loss aspect 192011 is about moving existing bookmarks not reliable This is about bookmarks not saved
Comment 4•22 years ago
|
||
Mozilla/5.0 Gecko/20030210 (Macintosh; U; PPC Mac OS X Mach-O; da-DK; rv:1.3b; MultiZilla v1.1.33 (a)) I'm seeing this too, but also in the following case: when creating more than one sub-folder only the first one created is retained on restart - all others are lost Question is, if this bug and bug 192011 ought to be merged ? In both cases the behavior is essentially the same : only the first action performed on the bookmarks is registered - all subsequent changes whether these are bookmarking a site, moving a bookmark or folder, creating folders etc are lost - in some cases leading to dataloss
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•22 years ago
|
Flags: blocking1.3?
It's quite a bad problem ... continuing in 1.3b (Mach-O). I had resorted to Exporting my bookmarks at some point, so now I tried going into bookmarks Manage .. importing the file, and deleting the previous folders (so that only the imported contents would be there). Quit and restart, these edits weren't retained either. Thanks; Larry.
I just started a new bookmarks.html file (using vi, so I'm sure it's a new inode and default file modes, etc. ... reading in the stuff that I had exported at some point). Then (after starting and exiting Moz) I started using the testcase specified in this bug description -- my build is 2003021017 i.e. 1.3b Mach-O. It's a good testcase, works exactly as Rija documented above. (Just want to affirm that it's still "there" and this testcase is good;) Larry.
Comment 7•22 years ago
|
||
We should get these OSX bookmarks bugs fixed for final. Samir, can someone on your team take this?
Flags: blocking1.3? → blocking1.3+
Updated•22 years ago
|
Blocks: profile-corrupt
Depends on: 192011
Comment 8•22 years ago
|
||
This does happen for me using this simple test case. The behavior is slightly different between my debug trunk build and an opt nightly: 1. With an opt build, after step 3, bookmarks after the 1st are not visible in the bookmarks menu. 2. With a debug build, after step 3, added bookmarks are visible in the menu. In both cases, the bookmarks are gone after quitting and relaunching. Reason I bring this up is this is the 2nd time I've seen a difference WRT bookmark persistence between opt and debug.
Comment 11•22 years ago
|
||
I have experienced a similar problem, also 1.3b on MacOS X. I've twice (before reading this report) created new bookmark folders and moved bookmarks around -- both times the changes are not saved. The second time I exported the bookmarks and substitued the bookmarks file so as not to lose my work. Bookmarks that I've created otherwise, without creating a new folder, have been saved correctly during seprate sessions in recent days.
Comment 12•22 years ago
|
||
I have seen something similar but not quite the same if I'm reading right. I can no longer save new bookmarks in the root (no folder) location either. They show up but are not saved on exit. I was able to add one by exporting and re importing my bookmarks but all other attempts now fail. Also any attempt to modify existing doesn't work either. Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030210
Assignee | ||
Comment 13•22 years ago
|
||
Conrad, I suspect it's a problem with nsLocalFileOSX::Clone() method nsBookmarksService::Flush() -> NS_GetSpecialDirectory(BOOKMARKS_FILE) -> nsDirectoryService->Get() -> cachedFile->Clone() NS_GetSpecialDirectory seems to return NS_OK, but when we call GetNativePath() on the cloned file it returns NS_ERROR_FILE_NOT_FOUND. I added a debug printf in nsLocalFile::Clone, mFSRef is always the same for bookmarks.html. It starts to fail after multiple (actually 2) calls to ::FSRefMakePath(&mFSRef, ...) I also tried to modify Clone() method to use default copy constructor or InitWithFile(), doesn't work either :( Any ideas ?
Comment 14•22 years ago
|
||
> It starts to fail after multiple (actually 2) calls to
::FSRefMakePath(&mFSRef, ...)
Calling FSRefMakePath more than once on the very same FSRef fails?
Assignee | ||
Comment 15•22 years ago
|
||
>Calling FSRefMakePath more than once on the very same FSRef fails? yeah http://developer.apple.com/techpubs/macosx/Carbon/Files/FileManager/File_Manager/DataTypes/FSRef.html#//apple_ref/c/tag/FSRef "The client of the File Manager cannot examine the contents of an FSRef to extract information about the parent directory or the object’s name. Similarly, an FSRef cannot be constructed directly by the client; the FSRef must be constructed and returned via the File Manager. There is no need to call the File Manager to dispose an FSRef ." Does it mean that we can't just copy mFSRef in the copy ctor ?
Comment 16•22 years ago
|
||
Nav triage team: nsbeta1+/adt1
Comment 17•22 years ago
|
||
> Does it mean that we can't just copy mFSRef in the copy ctor ?
I sure hope not. I'll ask on CarbonIT.
Assignee | ||
Comment 18•22 years ago
|
||
Never mind, it seems that WriteBookmarks() is doing something strange. I don't see the problem when I comment out WriteBookmarks(). I'll try to debug it more tomorrow.
Assignee | ||
Comment 19•22 years ago
|
||
Actually, it creates a temp file first and writes to that file. Then it deletes the old file and renames temp file to the original name. And that proably causes the problem.
Assignee | ||
Comment 20•22 years ago
|
||
Yeah, I hacked the bookmarks service to not use a temp file and I don't see the problem anymore.
Assignee | ||
Comment 21•22 years ago
|
||
Maybe we should you FSSpec instead of FSRef ?
Comment 22•22 years ago
|
||
Whew! From what you said before, I was really afraid so I wrote this test program: #include <Carbon/Carbon.h> #include <assert.h> int main (int argc, const char * argv[]) { OSErr err; FSRef fsRef1, fsRef2; UInt8 pathBuf[512]; err = FSFindFolder(kUserDomain, kDomainTopLevelFolderType, kDontCreateFolder, &fsRef1); assert(err == noErr); err = FSRefMakePath(&fsRef1, pathBuf, sizeof(pathBuf)); assert(err == noErr); printf("Path #1 of 1st FSRef is: %s\n", (char *)pathBuf); err = FSRefMakePath(&fsRef1, pathBuf, sizeof(pathBuf)); assert(err == noErr); printf("Path #2 of 1st FSRef is: %s\n", (char *)pathBuf); fsRef2 = fsRef1; err = FSRefMakePath(&fsRef2, pathBuf, sizeof(pathBuf)); assert(err == noErr); printf("Path #1 of 2nd FSRef is: %s\n", (char *)pathBuf); err = FSRefMakePath(&fsRef2, pathBuf, sizeof(pathBuf)); assert(err == noErr); printf("Path #2 of 2nd FSRef is: %s\n", (char *)pathBuf); return 0; } and it worked.
Comment 23•22 years ago
|
||
> Maybe we should you FSSpec instead of FSRef ?
No way. FSSpec isn't Unicode safe and it's limited to short file names. Takes us
back to the bad old days ;-)
Comment 24•22 years ago
|
||
> Then it deletes the old file and renames temp file to the original name.
And that proably causes the problem.
This is probably where the bug lies in nsLocalFileOSX.cpp.
Comment 25•22 years ago
|
||
The problem with an FSRef is that, if it refers to an existing file, and that file is deleted, that FSRef will be invalid - even if another file of the same name and location replaces the deleted file. So, using an FSRef to specify a file which may be deleted is no good (and pretty much means that the OSX file impl has to be rewritten to use CFURL instead). In the meanwhile, this patch makes directory service return a fresh copy of the bookmarks file each time it is requested. Then, we don't end up with a dangling, invalid FSRef.
Updated•22 years ago
|
Attachment #114855 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Target Milestone: --- → mozilla1.3final
Assignee | ||
Comment 26•22 years ago
|
||
That sounds reasonable, but it will probably decrease performance. Is there any other (long term) solution ?
Target Milestone: mozilla1.3final → ---
Assignee | ||
Comment 27•22 years ago
|
||
> (and pretty much means that the OSX file impl has to be rewritten to use CFURL
instead)
ah, so that's answer for my previous question, never mind
Assignee | ||
Comment 28•22 years ago
|
||
please file a new bug about rewritting OSX file impl, thanks
Comment 29•22 years ago
|
||
Comment on attachment 114855 [details] [diff] [review] Icky patch that works Ugh :-/.
Attachment #114855 -
Flags: superreview+
Assignee | ||
Updated•22 years ago
|
Attachment #114855 -
Flags: approval1.3?
Comment 30•22 years ago
|
||
See bug 164396.
Assignee | ||
Updated•22 years ago
|
Priority: -- → P1
Target Milestone: --- → mozilla1.3final
Comment 31•22 years ago
|
||
Comment on attachment 114855 [details] [diff] [review] Icky patch that works a=asa (on behalf of drivers) for checkin to 1.3
Attachment #114855 -
Flags: approval1.3? → approval1.3+
Assignee | ||
Comment 32•22 years ago
|
||
Conrad, can I check in for you ?
Comment 33•22 years ago
|
||
Yes. Thanks.
Assignee | ||
Comment 34•22 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 35•22 years ago
|
||
*** Bug 194191 has been marked as a duplicate of this bug. ***
Comment 36•22 years ago
|
||
*** Bug 194490 has been marked as a duplicate of this bug. ***
Comment 37•22 years ago
|
||
*** Bug 194516 has been marked as a duplicate of this bug. ***
Comment 38•22 years ago
|
||
*** Bug 194719 has been marked as a duplicate of this bug. ***
Comment 39•22 years ago
|
||
*** Bug 194851 has been marked as a duplicate of this bug. ***
Comment 40•21 years ago
|
||
*** Bug 194902 has been marked as a duplicate of this bug. ***
Comment 41•21 years ago
|
||
*** Bug 195310 has been marked as a duplicate of this bug. ***
Updated•21 years ago
|
Whiteboard: [adt1] → [adt1] fixed1.3
Comment 42•21 years ago
|
||
*** Bug 195838 has been marked as a duplicate of this bug. ***
Comment 43•21 years ago
|
||
*** Bug 195973 has been marked as a duplicate of this bug. ***
Comment 44•21 years ago
|
||
*** Bug 196639 has been marked as a duplicate of this bug. ***
Comment 45•21 years ago
|
||
Verified in the 2003-04-22-08 Macho trunk build.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Blocks: bookmark-loss
Updated•21 years ago
|
No longer blocks: profile-corrupt
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•