Closed
Bug 119504
Opened 24 years ago
Closed 24 years ago
Local: Empty trash puts the new trash folder in the wrong place
Categories
(MailNews Core :: Backend, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: naving, Assigned: waterson)
References
Details
(Keywords: regression)
Attachments
(1 file, 5 obsolete files)
|
8.07 KB,
patch
|
Details | Diff | Splinter Review |
It doesn't sort the new rash folder w.r.t other folders.
| Reporter | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Keywords: regression
| Reporter | ||
Comment 1•24 years ago
|
||
workaround : open and close the twisty on acct level folder
| Reporter | ||
Updated•24 years ago
|
Priority: -- → P3
Target Milestone: --- → mozilla0.9.8
| Reporter | ||
Comment 2•24 years ago
|
||
Insertion sort wasn't correct, I think this is the right fix.
| Reporter | ||
Comment 3•24 years ago
|
||
cc some contributors for review.
I don't know how it was working up until now. more likely that we changed
something that caused this code to be called.
Comment 4•24 years ago
|
||
Comment on attachment 64544 [details] [diff] [review]
proposed fix
looks good to me
r=varga
Attachment #64544 -
Flags: review+
| Reporter | ||
Comment 5•24 years ago
|
||
cc hyatt, looking for sr?
| Assignee | ||
Comment 6•24 years ago
|
||
Comment on attachment 64544 [details] [diff] [review]
proposed fix
sr=waterson
Attachment #64544 -
Flags: superreview+
| Reporter | ||
Comment 7•24 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 8•24 years ago
|
||
Reopening, backed out the fix. I will need to do some more investigation, looks
like it may break rename folder in some cases.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 9•24 years ago
|
||
This is a duplicate of bug 113788 AFAICS.
| Reporter | ||
Comment 10•24 years ago
|
||
*** Bug 113788 has been marked as a duplicate of this bug. ***
| Reporter | ||
Comment 11•24 years ago
|
||
new insertion sort, gives the correct position for all the cases tested
so far.
Attachment #64544 -
Attachment is obsolete: true
| Assignee | ||
Comment 12•24 years ago
|
||
Actually, I think this might be what we want. I'll double-check.
Attachment #65166 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•24 years ago
|
||
I don't think sorting is the problem here. I spent some time looking at the log
with NSPR_LOG_MODULES=nsXULTemplateBuilder:5, and I'm seeing pretty bizarre
behavior from the mailnews datasource. Perhaps this will all get better with the
fix for bug 120203?
For example, created the following folder structure:
imap://waterson@dredd.mcom.com/
|
+--> dummy top-level folder
|
+--> dummy child folder
Then I renamed ``dumy top-level folder'' to ``rufus''. As part of the rename,
the ``rufus'' folder was opened. The template builder asked for its kids, and
got ``dummy child folder-1'' in response to its query. And then, the datasource
push-notified the builder that ``rufus'' had a new child folder, ``dummy child
folder''. (Why not just respond to the initial query instead of push notifying?)
Unfortunately, this happened _before_ we'd removed the ``dummy top-level
folder'', which trips a bug that the rdfliner will get its knickers in a
horrible knot if there are two rows with the same URI in the builder. (Which
happens, because ``dummy child folder'' is already present under ``dummy
top-level folder''.) I'll look around and see if I can find that bug -- fixing
it might smooth over this problem.
But, we could definitely improve things by re-ordering the notifications. For
example, the folder rename operation should be processed without any hitches
(and without the above bug being fixed) if you:
- unassert the membership of the old folder from its container
- assert the membership of the new folder to its container
(You have to do this because you're changing the identity of the folder when you
monkey with its URI; otherwise, you could just kick out an `onchange'
notification for the folderName property.)
| Assignee | ||
Comment 14•24 years ago
|
||
Also, there _is_ a bug here with sorting: with respect to attachment 65189 [details] [diff] [review], I'm
pretty convinced that it's the right fix.
| Assignee | ||
Comment 15•24 years ago
|
||
I don't think I'd filed a bug on the one-resource-per-rdfliner problem, so I
filed one. I've added a dependency on bug 120229.
Depends on: 120229
| Assignee | ||
Comment 16•24 years ago
|
||
Applying the changes from bug 120203 significantly improve things! I'm still
seeing a bizarre problem where having open top-level folders throws off the
insertion. Looking at that now.
Depends on: 120203
| Assignee | ||
Comment 17•24 years ago
|
||
Okay, I was wrong on several counts. It looks like naving has already
implemented most of my RDF notification hacking suggestions in bug 120203.
Furthermore, there was a serious problem with the way that we inserted new rows
that had nothing to do with duplicate folders (so I'm removing the dependency on
bug 120229). I'm going to steal this bug, as it's mostly an rdfliner problem.
Patch coming up...
| Assignee | ||
Comment 18•24 years ago
|
||
So it turns out that ReplaceMatch() was pretty broken. It was failing to
account for any open subtrees that preceded the insertion point. I fixed this
by having nsOutlinerRows::InsertElementAt return an iterator that bookmarks the
insertion point. Since iterators know their absolute row index, we can pass
this along to the OpenSubtree call.
Sorry for the runaround on this one naving: do you think you could give this
patch a try? It seems to work for me when combined with your patch from bug
120203.
Attachment #65189 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 19•24 years ago
|
||
It turns out that this should fix the problem, with or without changes in bug
120203. (However, those changes ought to make the operation a bit speedier!)
| Assignee | ||
Comment 20•24 years ago
|
||
Comment on attachment 65208 [details] [diff] [review]
complete fix
Argh! Almost there, but doesn't quite work. (Try on a folder nested two
deep...)
Attachment #65208 -
Flags: needs-work+
| Assignee | ||
Comment 21•24 years ago
|
||
Fixes row accounting in nsOutlinerRows::Subtree::InsertRowAt. When walking up,
I needed to count one against the rowIndex for each parent to which we
ascended.
So, a summary of these changes:
- Fix insertion sort in nsXULOutlinerBuilder::ReplaceMatch. We were
decrementing |right| too aggressively.
- Alter nsOutlinerRows::InsertRowAt to return an iterator, so that we
know the absolute row index of the newly inserted row. Specifically,
this allows us to properly account for open folders that precede us in the
subtree.
- Alter nsOutlinerRows::Subtree::InsertRowAt to do the gruntwork of computing
the absolute row index of the inserted row. After insertion, it crawls
back to the root of the tree, accumulating path information into an iterator.
- Merge with Jan's recent changes.
Attachment #65208 -
Attachment is obsolete: true
| Reporter | ||
Comment 22•24 years ago
|
||
waterson, I will test your last patch.
Comment 23•24 years ago
|
||
I applied and tested the latest patch. No problems so far.
Although I can't test it with local/pop folders since they are horked.
Updated•24 years ago
|
Attachment #65248 -
Flags: review+
Comment 24•24 years ago
|
||
Comment on attachment 65248 [details] [diff] [review]
this one is money, baby!
r=varga
Comment 25•24 years ago
|
||
sr=hyatt
| Reporter | ||
Comment 26•24 years ago
|
||
It work fine for me. thanks for fixing it.
There is one minor nit about one case. Two folders like this b child of a
a
--b
if you delete b, the twisty of a is still there. I don't know if it
something related or different.
| Assignee | ||
Comment 27•24 years ago
|
||
Yeah, I've seen that, too. Let's file another bug on that: I'm pretty sure it's
a different issue.
| Assignee | ||
Comment 28•24 years ago
|
||
While investigating bug 95748, I discovered a small problem with attachment
65248 [details] [diff] [review]. Specifically, the initial accumulation of |rowIndex| isn't quite right
in nsOutlinerRows::Subtree::InsertRowAt: it starts down one row too far, and
doesn't count the first row. Here's the difference between attachment 65248 [details] [diff] [review] and
this patch:
@@ -59,7 +59,7 @@
+ iterator result;
+ result.Push(this, aIndex);
+
-+ for ( ; aIndex > 0; --aIndex, ++rowIndex) {
++ for ( ; --aIndex >= 0; ++rowIndex) {
+ // Account for open subtrees in the absolute row index.
+ const Subtree *subtree = mRows[aIndex].mSubtree;
+ if (subtree)
It doesn't include the subtree size of the row that was just added (that won't
affect the insertion position), but it _does_ include the subtree size of the
first row (index 0) in the current subtree.
Attachment #65248 -
Attachment is obsolete: true
| Assignee | ||
Comment 29•24 years ago
|
||
One more change (to code that's actually not used right now):
+nsOutlinerRows::iterator::Push(Subtree *aParent, PRInt32 aChildIndex)
+{
+ if (mTop < kMaxDepth - 1) {
-+ for (PRInt32 i = mTop - 1; i >= 0; ++i)
++ for (PRInt32 i = mTop; i >= 0; ++i)
+ mLink[i + 1] = mLink[i];
+
+ mLink[0].mParent = aParent;
+ mLink[0].mChildIndex = aChildIndex;
++ ++mTop;
+ }
+ else
+ NS_ERROR("overflow");
I screwed up the implementation of `Push': mTop is the last valid index, so I
was off-by-one in the loop. Also, I forgot to increment mTop after pushing.
| Assignee | ||
Comment 31•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 32•24 years ago
|
||
is a clobber required for this fix?
I just built with it from cvs, and now crash on linux shortly after clicking the
mailnews icon bottom right in browser. Deleting all in dist and rebuilding
didn't help. Backing out this checkin and rebuilding cured the crash however.
The backtrace from a non-debug is short:
(gdb) bt
#0 0x40f85b4d in nsOutlinerRows::iterator::Push () from libgkcontent.so
#1 0x40f85998 in nsOutlinerRows::Subtree::InsertRowAt () from libgkcontent.so
(gdb)
| Assignee | ||
Comment 33•24 years ago
|
||
No, I'm a moron, and didn't check that last bit of patch I attached very
carefully (comment 29). The fix is in the tree now (after two tries!): update
mozilla/content/xul/templates/src/nsOutlinerRows.cpp, rebuild content. Sorry.
Comment 34•24 years ago
|
||
Twisty does not go away after empty trash with folders or after deleting a
subfolder is a known problem. I found a bug 88273 an old one which describes the
same problem. I don't think we need to log a new bug for that.
Comment 35•24 years ago
|
||
verified this on 2002-01-25-06 linux, win98
2002-01-24-06 mac os x
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•18 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•