Closed
Bug 594523
Opened 14 years ago
Closed 14 years ago
When tab location changes, the HUDService fails to clear/update state information
Categories
(DevTools :: General, defect, P1)
DevTools
General
Tracking
(blocking2.0 betaN+)
RESOLVED
DUPLICATE
of bug 611789
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: msucan, Assigned: msucan)
References
Details
(Whiteboard: [patchclean:1002])
Attachments
(1 file, 4 obsolete files)
13.18 KB,
patch
|
Gavin
:
review-
|
Details | Diff | Splinter Review |
STR (from a mochitest file):
1. open tab 1
a) load urlA
b) open the Web Console
c) load urlB
2. open tab 2
a) open urlA
b) open the Web Console
3. call:
let display1 = HUDService.getDisplayByURISpec(urlA);
let display2 = HUDService.getDisplayByURISpec(urlB);
isnot(display1, display2, "the display nodes must be different");
Expected result: test passes.
Actual result: test fails.
Problem at hand: the HUDService fails to acknowledge the user navigated to a different URL in tab1, for that HUD object, so the uriRegistry holds the hud panel ID of both tabs for urlA.
Will attach a mochitest file that shows the problem.
Assignee | ||
Comment 1•14 years ago
|
||
This is a mochitest case which shows the error.
Comment 2•14 years ago
|
||
I just tried this. The user impact appears to be that the messages for Tab 2 appear in the console for Tab 1.
This looks like the kind of bug that someone could reasonably hit and be quite confused by. I'm scheduling this for us to work on in beta 7.
Also, I'm requesting blocking status for this, because this bug would be ugly.
Blocks: devtools4b8
blocking2.0: --- → ?
Updated•14 years ago
|
blocking2.0: ? → betaN+
Comment 4•14 years ago
|
||
The tests for this bug also need to trigger "back" and "forward" so we can properly update the console when we observe back and forward events.
Now, this may become a moot point once the lazy console lands, as it ties itself to the window in a different way, via the outer window ID
Updated•14 years ago
|
Assignee: nobody → mihai.sucan
Assignee | ||
Comment 5•14 years ago
|
||
Proposed fix and test code.
This patch includes the mochitest I had attached when I reported the bug.
This patch depends on the patch from bug 597103.
Notes on some changes I did:
- bug 595350 introduced closeConsoleOnTab() which serves the same purpose as the older deactivateHUDForContext()
- bug 597103 fixes an issue with the handling of deactivation of the Web Console from unfocused windows.
- this patch needed a way to remove the nsIWebProgressListener from all tabs once the Web Console is no longer active in any tab. Hence I had to unify closeConsoleOnTab() and deactivateHUDForContext(). This meant I also needed the fixes from bug 597103.
Attachment #473195 -
Attachment is obsolete: true
Attachment #477233 -
Flags: feedback?(rcampbell)
Assignee | ||
Updated•14 years ago
|
Assignee | ||
Comment 6•14 years ago
|
||
Rebased patch.
Attachment #477233 -
Attachment is obsolete: true
Attachment #478761 -
Flags: feedback?(rcampbell)
Attachment #477233 -
Flags: feedback?(rcampbell)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [patchclean:0921] → [patchclean:0927]
Comment 7•14 years ago
|
||
Comment on attachment 478761 [details] [diff] [review]
rebased patch
+ let foundHuds = false;
+ for (let id in this.displayRegistry) {
+ foundHuds = true;
+ break;
+ }
You're just looking for non-emptiness here, right? How about something like,
let foundHuds = this.displayRegistry.keys().length > 0;
... instead? Multiple locations.
I'd even consider breaking that into a separate method for readability.
Rest of the code + test file look good, I think.
This code may not be necessary if David's lazyConsole stuff fixes this, but good to have and the test might be useful there anyway.
Attachment #478761 -
Flags: feedback?(rcampbell) → feedback+
Assignee | ||
Comment 8•14 years ago
|
||
(In reply to comment #7)
> Comment on attachment 478761 [details] [diff] [review]
> rebased patch
>
> + let foundHuds = false;
> + for (let id in this.displayRegistry) {
> + foundHuds = true;
> + break;
> + }
>
> You're just looking for non-emptiness here, right? How about something like,
>
> let foundHuds = this.displayRegistry.keys().length > 0;
>
> ... instead? Multiple locations.
>
> I'd even consider breaking that into a separate method for readability.
Sure, I can change that. Will update the patch.
> Rest of the code + test file look good, I think.
>
> This code may not be necessary if David's lazyConsole stuff fixes this, but
> good to have and the test might be useful there anyway.
I'm not sure either. I haven't seen the latest patches from David's lazy console stuff.Somehow I think this patch is still needed, but with some rebasing. His work touches on the aspects of window.console, while this code touches on aspects of how the HUD Service manages HUDs. Time will tell. :)
Thanks for the feedback+!
Assignee | ||
Comment 9•14 years ago
|
||
Updated patch based on feedback from Robert. Thanks!
Asking for review from Shawn now.
Attachment #478761 -
Attachment is obsolete: true
Attachment #479016 -
Flags: review?(sdwilsh)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [patchclean:0927] → [patchclean:0928]
Comment 10•14 years ago
|
||
Comment on attachment 479016 [details] [diff] [review]
updated patch
I'm going to defer to a browser peer on this because you are adding and twiddling a property on gBrowser (and using methods on it, which I'm not familiar with). However, noticed some things that I'll comment on...
>+ removeProgressListener: function HS_removeProgressListener(aGBrowser)
>+ {
>+ let foundHuds = Object.keys(this.displayRegistry).length > 0;
>+
>+ if (!foundHuds && aGBrowser._WebConsoleProgressListenerAttached) {
It's not clear to me why you do this if there are no HUDs found. I think a comment explaining this could be handy.
>+ onLocationChange:
>+ function CPL_onLocationChange(aBrowser, aProgress, aRequest, aLocation)
usually we'd put whatever arguments don't fit on the first line on the second one lined up with the first argument
>+ let oldIndex = history.index-1;
spaces around the minus please
comment 4 also seems to not be addressed in the test
Attachment #479016 -
Flags: review?(sdwilsh) → review?(gavin.sharp)
Assignee | ||
Comment 11•14 years ago
|
||
Updated patch. Addressing comment 4 and the comments from Shawn. Sorry I missed that comment.
I added testing of going back and forward. This semi-worked with the previous patch, but I had to make some improvements to better handle more cases of navigation in history.
Thanks Shawn!
Attachment #479016 -
Attachment is obsolete: true
Attachment #480414 -
Flags: review?(gavin.sharp)
Attachment #479016 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [patchclean:0928] → [patchclean:1002]
Comment 12•14 years ago
|
||
Comment on attachment 480414 [details] [diff] [review]
patch update 2
I think we need to focus on getting rid of these "registries", rather than doing more work to ensure they are properly updated.
Attachment #480414 -
Flags: review?(gavin.sharp) → review-
Comment 13•14 years ago
|
||
(In reply to comment #12)
> Comment on attachment 480414 [details] [diff] [review]
> patch update 2
>
> I think we need to focus on getting rid of these "registries", rather than
> doing more work to ensure they are properly updated.
Do you have any general approaches in mind? It is a shame we have all of them, but I was unsure how to track things otherwise.
Assignee | ||
Comment 14•14 years ago
|
||
Gavin: what I believe we can do is.... remove the uriRegistry, _headsUpDisplay and some other registries. I'd like us to keep only a minimum of:
- hudReferences which maps hudIds to HeadsUpDisplay objects (like we have now)
- windowIds which maps outer window IDs to hudIds.
This would allow us to: find the HUD object based on its hudId, or based on the windowId. It would also allow us to find the HUD object based on the window object. These are pretty much all of the cases we need.
Does this sound fine to you? If yes, then such work should be done in bug 611789. In that patch we can also remove getHeadsUpDisplay() ... as needed for bug 592469.
Comment 15•14 years ago
|
||
Yeah, that sounds like a good plan.
Assignee | ||
Comment 18•14 years ago
|
||
Submitted the patch for bug 611789, which provides a better solution to the issue reported here. I am setting bug 611789 as a dependency.
Depends on: 611789
Updated•14 years ago
|
Severity: blocker → normal
Assignee | ||
Comment 19•14 years ago
|
||
This is now fixed by bug 611789.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•