Port Bug 1482389 Convert TreeBoxObject to XULTreeElement - Malfunction: Deletion of message opened in tab or stand-alone windows not working as expected
Categories
(MailNews Core :: General, task)
Tracking
(thunderbird68+ fixed, thunderbird69 fixed)
People
(Reporter: jorgk-bmo, Assigned: darktrojan)
References
Details
(Whiteboard: [Thunderbird-testfailure: Z all][Thunderbird-disabled-test][XBL:31])
Attachments
(5 files, 11 obsolete files)
12.97 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
110.61 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
2.11 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
26.03 KB,
patch
|
Details | Diff | Splinter Review | |
37.57 KB,
patch
|
mkmelin
:
review+
jorgk-bmo
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
I applied
https://hg.mozilla.org/integration/mozilla-inbound/rev/af06731b5203
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd20e420f257
https://hg.mozilla.org/integration/mozilla-inbound/rev/c1cfc595892f
and got compile errors, so far only
#include "nsITreeBoxObject.h" not found.
Reporter | ||
Comment 1•5 years ago
|
||
Looks like we also need to do this:
-
tree.treeBoxObject.ensureRowIsVisible(i);
-
tree.ensureRowIsVisible(i);
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd20e420f257#l14.75
in a bunch of places:
https://searchfox.org/comm-central/search?q=treeBoxObject.ensureRowIsVisible&case=false®exp=false&path=
What about this:
https://searchfox.org/comm-central/search?q=treeBox.ensureRowIsVisible&case=false®exp=false&path=
Reporter | ||
Comment 2•5 years ago
|
||
Wow, that code got interpreted as formatting :-(
- tree.treeBoxObject.ensureRowIsVisible(i);
+ tree.ensureRowIsVisible(i);
Reporter | ||
Comment 3•5 years ago
|
||
This appears to compile so far, I commented out three lines with XXX that resisted compilation. Needs further looking at.
Reporter | ||
Comment 4•5 years ago
|
||
This compiles, and no more commented-out code :-)
Over to the JS part. I'm going to do what I said in comment #2, so s/treeBoxObject.ensureRowIsVisible/ensureRowIsVisible/.
Paolo, what about treebox.ensureRowIsVisible()? That's something else? Sorry, pattern-matchers at work ;-)
Reporter | ||
Comment 5•5 years ago
|
||
Wow, the JS part is going to be massive, all access via .treeBoxObject needs to go.
Reporter | ||
Comment 6•5 years ago
|
||
Magnus, we have a problem here. nsITreeBoxObject is removed and we still have it in FakeTreeBoxObject in folderDisplay.js.
JS patch coming in a minute.
Reporter | ||
Comment 7•5 years ago
|
||
This is what I have so far. The folder tree displays, but the thread pane/message list doesn't.
I see:
this.treeBox.getFirstVisibleRow is not a function folderDisplay.js:1742
TypeError: treeBox.getFirstVisibleRow is not a function folderDisplay.js:2473:17
Reporter | ||
Comment 8•5 years ago
|
||
OK, with this patch, the thread pane has returned.
I've also looked at
https://searchfox.org/comm-central/search?q=treeBox.ensureRowIsVisible&case=false®exp=false&path=
'treeBox' was an object property here. I've renamed it to 'tree'.
Comment 9•5 years ago
|
||
Comment on attachment 9035410 [details] [diff] [review] 1518823-treebox.patch - v1 Review of attachment 9035410 [details] [diff] [review]: ----------------------------------------------------------------- Looks reasonable to me
Reporter | ||
Comment 10•5 years ago
|
||
Oops, never sent this:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=51ddd5d04999b44262dec60685c7e7da1a506d21
It's totally red. Locally I see:
JavaScript error: chrome://messenger/content/messageWindow.js, line 105: NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument arg 0 [nsITreeView.setTree]
Also, Geoff pointed out that there is treeBoxObject in XML files :-(
Reporter | ||
Comment 11•5 years ago
|
||
Grrr, messageWindow.js, line 105 is that fake stuff that is biting us now :-(
this.view.dbView.setTree(this._fakeTreeBox);
Reporter | ||
Comment 12•5 years ago
|
||
OK, this elimitates treeBoxObject from mailWidgets.xml. I don't think it will make test better, but we can see:
Reporter | ||
Comment 13•5 years ago
|
||
For the "fake stuff", take a look at bug 1434641 comment #6 downwards.
Reporter | ||
Comment 14•5 years ago
|
||
OK, had a stab at the fake stuff:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=21f9b94d52279b95fac2d46f07be1ec42df27361
Reporter | ||
Comment 15•5 years ago
|
||
I still see
NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument arg 0 [nsITreeView.setTree] folderDisplay.js:1776
Looks like the removal of nsITreeBoxObject also took away the possibility of simulating a fake tree in JS, right?
Reporter | ||
Comment 16•5 years ago
|
||
OK, now with:
1776: // this.view.dbView.setTree(this._fakeTree);
Reporter | ||
Comment 17•5 years ago
|
||
And another one with folderDisplay.js also
105: // this.view.dbView.setTree(this._fakeTree);
Assignee | ||
Comment 18•5 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #15)
I still see
NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument arg 0 [nsITreeView.setTree] folderDisplay.js:1776Looks like the removal of nsITreeBoxObject also took away the possibility of simulating a fake tree in JS, right?
Does your change fake object QI to the right interface?
Reporter | ||
Comment 19•5 years ago
|
||
No, it doesn't, see comment #6. It's the:
https://searchfox.org/comm-central/rev/58f568fcebd755ece1b6c6622c45a62decd481d7/mail/base/content/folderDisplay.js#2662
But with the removal of nsITreeBoxObject, the XPCOM-ness is gone, no? What should I QI to?
Assignee | ||
Comment 20•5 years ago
|
||
The IDL says XULTreeElement: https://hg.mozilla.org/try/rev/59b0eb21a4fb#l53.31
But how you do that and whether it actually matters or not, I don't know.
Reporter | ||
Comment 21•5 years ago
|
||
I also get:
JavaScript error: chrome://messenger/content/threadPane.js, line 70: TypeError:
col.value is undefined
JavaScript error: chrome://messenger/content/threadPane.js, line 64: TypeError:
col.value is undefined
That's from tree.getCellAt(event.clientX, event.clientY, row, col, elt);
Reporter | ||
Comment 22•5 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #20)
The IDL says XULTreeElement: https://hg.mozilla.org/try/rev/59b0eb21a4fb#l53.31
But how you do that and whether it actually matters or not, I don't know.
Yes, that let's me remove the
// this.view.dbView.setTree(this._fakeTree);
Let's try again, but the errors from comment 21 don't help :-(
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=43f09c2ebcf540656adf12af734c3cebe141aa82
Reporter | ||
Comment 23•5 years ago
|
||
oops, we need to replace the getCellAt() call:
https://hg.mozilla.org/integration/mozilla-inbound/rev/af06731b5203#l2.15
Reporter | ||
Comment 24•5 years ago
|
||
OK, fixed the QI and all the getCellAt() calls.
Reporter | ||
Comment 25•5 years ago
|
||
If I throw this in, the thread pane shows and I can open a message in a tab and a new window. Closing the tab crashes, but hey, you can't have everything.
Reporter | ||
Comment 26•5 years ago
|
||
Fixed another typo in a separate patch:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=2c0781e246e6b9d912197eaefb53bf7c34a59f37
Note: Since this is not based on "normal" M-C but on a try changeset, the jobs can't be cancelled :-( - well, or only individually with the TaskCluster tool.
Reporter | ||
Comment 27•5 years ago
|
||
Reporter | ||
Comment 28•5 years ago
|
||
OK, I've folded the misc. fixes into the main patch here.
With disable-fake.patch the try had three of the four Z's green (modulo the pesky testTaskView.js).
Z2 is red with multiple failures in four tests:
folder-display/test-deletion-from-virtual-folders.js
folder-display/test-deletion-with-multiple-displays.js
folder-display/test-folder-pane-visibility.js
folder-display/test-pane-focus.js
folder-display/test-close-window-on-delete.js
Magnus, what's the way forward here?
Reporter | ||
Comment 29•5 years ago
|
||
Sigh, another two call sites of getCellAt() needed fixing. Here's another try with the fake stuff disabled:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=717849595eb4a84c7f00169b3bc1e9b4bfdf8ecb
Comment 30•5 years ago
|
||
Looking, but doesn't look like fun.
Reporter | ||
Comment 31•5 years ago
|
||
Looks like the try form comment #29 is worse than the one from comment #27 :-(
Comment 32•5 years ago
|
||
Comment on attachment 9035386 [details] [diff] [review]
1518823-nsITreeBoxObject.patch (v1)
(In reply to Jorg K (GMT+1) from comment #4)
Paolo, what about treebox.ensureRowIsVisible()?
What's been done in this bug seems alright. Methods like this one that were on nsITreeBoxObject are now called on the <tree> element. As for FakeTreeBoxObject, probably you have to look into why it exists and whether there's an alternative way of achieving the same effect. In some cases I found that complex code could be converted to a one-liner in the original XBL binding, and I think we can consider a patch for a solution like this for the <tree> element if necessary.
Reporter | ||
Comment 33•5 years ago
|
||
Sadly there are too many bugs involved in this area. In M-C we have bug 1434641 and bug 1482389, in C-C we have this bug here and also bug 1514624 which removed a snippet.
The main reading re. the "fake stuff" is in bug 1434641 comment #6 and further down (cmt 8 and 12).
Reporter | ||
Comment 34•5 years ago
|
||
Comment on attachment 9035386 [details] [diff] [review]
1518823-nsITreeBoxObject.patch (v1)
This will have to land soon.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 35•5 years ago
|
||
This is sadly necessary.
Comment 36•5 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/8015b21deff6
No bug - Disable Nightly builds until XUL tree issue is fixed. a=jorgk DONTBUILD
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Comment 37•5 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/85114397b4c8 Port bug 1482389: Replace nsITreeBoxObject with XULTreeElement. rs=bustage-fix https://hg.mozilla.org/comm-central/rev/96b12a150fe1 Port bug 1482389: Remove acces via .treeBoxObject and .boxObject. rs=bustage-fix https://hg.mozilla.org/comm-central/rev/561033e56bac Port bug 1482389: Disable assigning fake JS tree. rs=bustage-fix
Reporter | ||
Comment 38•5 years ago
|
||
BTW, message display in a tab works and "b", "f" and "n" (what does that do?) appear to work.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 39•5 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #38)
BTW, message display in a tab works and "b", "f" and "n" (what does that
do?) appear to work.
Go to previous, next, next unread message.
Reporter | ||
Comment 40•5 years ago
|
||
Andrew, thanks for the explanation in bug 1434641 comment #6 and further down.
Would it be possible to move the implementation of the "fake tree" to C++ code?
https://searchfox.org/comm-central/rev/a8aec0d10f547e8181430a41db331e710a5c9382/mail/base/content/folderDisplay.js#2588
As I understand the immediate problem, nsITreeBoxObject is no longer an XPCOM object, so the tree can't be implemented in JS any more, that's why we had to disable these assignments: https://hg.mozilla.org/comm-central/rev/561033e56bac
For the uninitiated, your comment six in the other bug is hard to digest since it refers to the "pre-tab" times and mentions a completing a "change-over".
Reporter | ||
Comment 41•5 years ago
|
||
Not the standard way to turn off tests, but this was quickest.
Reporter | ||
Comment 42•5 years ago
|
||
Comment 43•5 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/b18b1440b89e Backed out changeset 8015b21deff6 to re-enable Nightly builds . a=jorgk https://hg.mozilla.org/comm-central/rev/a77580b97618 Bulk turn off all subtests in three failing tests. rs=bustage-fix
Comment 44•5 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #40)
Would it be possible to move the implementation of the "fake tree" to C++ code?
https://searchfox.org/comm-central/rev/a8aec0d10f547e8181430a41db331e710a5c9382/mail/base/content/folderDisplay.js#2588
There's no reason the fake tree need be implemented in JS. It was just very easy and there were no scaling problems. If you can implement a C++ subclass and aren't going to run into problems where methods aren't virtual, then that does seem like a way to maintain the status quo.
As I understand the immediate problem, nsITreeBoxObject is no longer an XPCOM object, so the tree can't be implemented in JS any more, that's why we had to disable these assignments: https://hg.mozilla.org/comm-central/rev/561033e56bac
I'm not really following the work in the other bugs, just trying to provide context.
For the uninitiated, your comment six in the other bug is hard to digest since it refers to the "pre-tab" times and mentions a completing a "change-over".
Thunderbird used to not have any tabs. Then tabs were implemented as a major hack where the user thought they had N 3-pane UI's working as separate, parallel things. But in fact it's just one set of widgets having hacky things done to them when the tab changes. The Folder Display abstractions were created to normalize the hack and provide a (more) sane API to add-ons as a first step to changing-over to not having any hack.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 46•5 years ago
|
||
I'm going to see whether changing the FakeTree implementation in folderDisplay.js to C++ is going to fix the immediate issue and maintain the status quo. That's a lot of boiler plate to be written :-(
Reporter | ||
Comment 47•5 years ago
|
||
I got confused and spent some time in the wrong boat :-(
FakeTree
doesn't implement a "tree view" (nsITreeView
) which we could extend, but the former nsITreeBoxObject
which was replaced by the final class XULTreeElement:
https://searchfox.org/comm-central/rev/3d98ee9af358660c44644d24b738f17261165ca6/mozilla/dom/xul/XULTreeElement.h#29
So nothing can be derived from it and it mostly doesn't have virtual methods.
Reporter | ||
Updated•5 years ago
|
Comment 50•5 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/978efb2e64bc Follow-up: Fix left-over 'col.value' breaking the subscribe tree. r=me DONTBUILD
Reporter | ||
Comment 51•5 years ago
•
|
||
TB 66 beta 3:
https://hg.mozilla.org/releases/comm=beta/rev/df1d9106a00f4c8436a0256750ae9882a1c6c478
EDIT: Destroyed the correct links do the c-b landing doesn't prevent this from showing up in my uplift query.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 53•5 years ago
|
||
Tests disabled here:
test-close-window-on-delete.js - 7
test-deletion-from-virtual-folders.js - 12
test-deletion-with-multiple-displays.js - 21
Geoff notices that 9 can be re-enabled since they pass now or never failed and were just a victim of hasty whole-sale disabling. Thanks Geoff. There will still be tests disabled in all three files.
Comment 54•5 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/1fa6d6d6dd6c Re-enable 9 tests that now pass (or never failed). r=jorgk DONTBUILD
Reporter | ||
Comment 58•5 years ago
|
||
Magnus, what's the way forward here? Can you put one person from your de-XBL team onto this job. Duplicates are piling up. The malfunction is that deletion of messages opened in a tab or stand-alone window doesn't behave as expected any more.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 60•5 years ago
|
||
This isn't very polished and it may well cause other problems, but it does cause 20 previously-failing tests to pass.
I've done two Try runs with some retriggering and not had a green Z2 on Linux yet. (Green on Mac first time on both runs.) I don't think that is related, but it could be.
Reporter | ||
Comment 61•5 years ago
|
||
Thanks, Geoff.
I had a bit of trouble looking at those try runs, like this one: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=0367a0aac8478088e5108a8e49a4a70cff8c6598
So I started my own:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=e24022251ffeae43ec05cc6a774693e396f0b5f2
Assignee | ||
Comment 62•5 years ago
|
||
Ben I'd be interested to know if attachment 9067268 [details] [diff] [review] would solve your bug 1551973.
Assignee | ||
Comment 63•5 years ago
|
||
All tests fixed. This try run has very similar code, but I'll do another with the final changes just to make sure.
Reporter | ||
Comment 64•5 years ago
|
||
Wow, "all tests fixed" is referring to all the 31 tests, not just the 20 from the previous patch. Fantastic!!
Assignee | ||
Comment 65•5 years ago
|
||
Linux debug shows a failure (doesn't it always?…), but I'm pretty sure it's just doing things out-of-order and I can fix it by making the test wait for the expected value to appear.
Comment 66•5 years ago
|
||
Comment on attachment 9068288 [details] [diff] [review] 1518823-deletion-2.diff Review of attachment 9068288 [details] [diff] [review]: ----------------------------------------------------------------- I get an area under the status bar, which is apparently showing the fake tree? Besides that, does seem to work properly. ::: mail/base/content/folderDisplay.js @@ +1204,1 @@ > return; seems like an odd change to declare the shouldReturn. Isn't the only change the this._deleteInProgress = false; addition? ::: mail/base/content/messageDisplay.js @@ +504,5 @@ > // close the tab. > if (this.folderDisplay.view.dbView.rowCount == 0) { > if (!this.closing) { > this.closing = true; > + setTimeout(() => { why the timeouts?
Comment 67•5 years ago
|
||
Geoff: Thanks for working on this!
> + setTimeout(() => {
Yes, please never use timeouts in production code. Esp. never ever as a workaround. They are fine in test code, but not in the real app code.
Assignee | ||
Comment 68•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #66)
I get an area under the status bar, which is apparently showing the fake
tree?
It should have a height of 0. Why doesn't it?
seems like an odd change to declare the shouldReturn. Isn't the only change
the this._deleteInProgress = false; addition?
_deleteInProgress
needs to be false, after calling messageDisplay.onMessagesRemoved
. You have a better way of doing it?
why the timeouts?
It seems like something things are happening out-of-order. At these points I think the selected message in the tree has changed but whatever the title-setting code needs is further down the event loop.
Comment 69•5 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #68)
(In reply to Magnus Melin [:mkmelin] from comment #66)
I get an area under the status bar, which is apparently showing the fake
tree?It should have a height of 0. Why doesn't it?
Can't say. Dev tools says the element is 46px, but is confused as to why. Using display: none hides it though.
When starting up with a few messages open in tabs, I got a few of these trees down there, and then some infinite jumping around.
why the timeouts?
It seems like something things are happening out-of-order. At these points I
think the selected message in the tree has changed but whatever the
title-setting code needs is further down the event loop.
Would be good to track this down, or at the minimum add a TODO item linking to a bug to do that, and some explanation.
Assignee | ||
Comment 70•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #69)
Can't say. Dev tools says the element is 46px, but is confused as to why. Using display: none hides it though.
Using display: none also stops it from working.
Assignee | ||
Comment 71•5 years ago
|
||
visibility: collapse
seems to be okay. The extra tree view never showed for me but it did on TaskCluster, sometimes. Anyway, this works:
Comment 72•5 years ago
|
||
Comment on attachment 9068897 [details] [diff] [review] 1518823-deletion-3.diff Review of attachment 9068897 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, r=mkmelin ::: mail/base/content/folderDisplay.js @@ +1197,5 @@ > onMessagesRemoved() { > FolderDisplayListenerManager._fireListeners("onMessagesRemoved", > [this]); > > + let shouldReturn = this.messageDisplay.onMessagesRemoved(); maybe name it handled, instead of shouldReturn
Reporter | ||
Comment 73•5 years ago
|
||
Comment on attachment 9068897 [details] [diff] [review] 1518823-deletion-3.diff Review of attachment 9068897 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/base/content/folderDisplay.js @@ +1199,5 @@ > [this]); > > + let shouldReturn = this.messageDisplay.onMessagesRemoved(); > + this._deleteInProgress = false; > + if (shouldReturn) Umm, can't you move `this._deleteInProgress = false;` up and then: ``` if (this.messageDisplay.onMessagesRemoved()) return; ``` like it was?
Comment 74•5 years ago
|
||
I asked earlier, but looking more, I suspect not since onMessagesRemoved checks that.
Assignee | ||
Comment 75•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #72)
::: mail/base/content/folderDisplay.js
@@ +1197,5 @@onMessagesRemoved() {
FolderDisplayListenerManager._fireListeners("onMessagesRemoved",
[this]);
- let shouldReturn = this.messageDisplay.onMessagesRemoved();
maybe name it handled, instead of shouldReturn
Yeah go on, rename it. I'm not fussy.
Comment 76•5 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/8c7373a378b6
Replace FakeTree with a real tree and re-enable 31 disabled tests. r=mkmelin DONTBUILD
Reporter | ||
Comment 77•5 years ago
|
||
Landed with the variable renamed. I'll leave the target milestone at TB 66 since that's when the initial stuff landed. The final patch landed at TB 69 and will be backported to TB 68.
Reporter | ||
Updated•5 years ago
|
Comment 78•5 years ago
|
||
I've built trunk and verified that this indeed fixes bug 1551973. That was the worst regression in TB 68, and highly annoying, so thanks a lot for fixing this!
Reporter | ||
Comment 79•5 years ago
|
||
Comment 80•5 years ago
|
||
when will this fix be available to those of us running 67.0b3 32 bit version
Reporter | ||
Comment 81•5 years ago
|
||
It will ship in 68.0 beta 1 next week.
Comment 83•5 years ago
|
||
Thank you for fixing this! I quit using Daily because of it. Drove me nuts. Now I will go back.
Updated•5 years ago
|
Description
•