Closed Bug 597756 Opened 10 years ago Closed 9 years ago

Fx 4 Web Console fails to show javascript errors if a tab is closed and the same document is then re-opened in a new tab

Categories

(DevTools :: General, defect)

x86
Windows XP
defect
Not set

Tracking

(blocking2.0 betaN+)

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: duncan.loveday, Assigned: msucan)

References

Details

(Keywords: regression, testcase, Whiteboard: [patchclean:1119])

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b6pre) Gecko/20100918 Firefox/4.0b6pre
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b6pre) Gecko/20100918 Firefox/4.0b6pre

In firefox 4, when a document is loaded in a tab for the first time since the browser started any javascript errors are visible in the web console - good so far. But close the tab, open a new tab, reload the same document and javascript errors are no longer reported to the console. This is bad.

Reproducible: Always

Steps to Reproduce:
1. Starting with a new browser session, open a new tab and load the test case.
2. Open the web console.
3. Click the button a few times and note that an error appear in the console for each click.
4. Close the tab.
5. Open a new tab and load the test case again.
6. Open the web console.
7. Click the button a few times and note that an error no longer appears in the console for each click.
Actual Results:  
In step 7, no errors are seen.

Expected Results:  
In step 7, the same errors should be seen as in step 3.
Attached file Test case
Keywords: regression, testcase
If you have two tabs open each containing the test case, errors from both tabs are reported to the web console in the first tab.

That's probably the root cause of this bug. Even after the first tab is closed, errors from other tabs containing the same document are reported to the web console on the already-closed tab.
This is very similar to Bug 595889, however the specific case where the first tab to contain a given URL is closed is not mentioned in that bug.
(In reply to comment #3)
> This is very similar to Bug 595889, however the specific case where the first
> tab to contain a given URL is closed is not mentioned in that bug.

Yes, these are separate issues. A probable fix is making sure we have expired all registries that keep url references, etc on tabClose
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → mihai.sucan
Blocks: 594894
Blocks: devtools4b8
No longer blocks: 594894
I have tested this and I see it's fixed. Having looked through the source code, I believe that the patch from bug 595350 has fixed this issue as well. This bug can thus be marked as WFM.

Bug 595350 has a mochitest but it doesn't test for this issue. I'll submit a mochitest here.
Status: NEW → ASSIGNED
Attached patch mochitest (obsolete) — Splinter Review
Automated mochitest. We should commit this so we make sure this bug doesn't crop out back again.

This specific situation is not tested by other tests, if i am not mistaken.
Attachment #477258 - Flags: feedback?(rcampbell)
Comment on attachment 477258 [details] [diff] [review]
mochitest

looks good
Attachment #477258 - Flags: feedback?(rcampbell) → feedback+
Comment on attachment 477258 [details] [diff] [review]
mochitest

Thanks Robert for the feedback+!

Asking for review and approval2.0. This is a patch that adds a mochitest which checks if the issue reported here is fixed or not. Thanks!
Attachment #477258 - Flags: review?(gavin.sharp)
Attachment #477258 - Flags: approval2.0?
Requesting blocking for this bug. Having messages suppressed because the URL is open in a different window is a bug that would probably hit many users.
blocking2.0: --- → ?
blocking2.0: ? → betaN+
Version: unspecified → Trunk
Attachment #477258 - Flags: review?(gavin.sharp) → review+
Attached patch rebased patch (obsolete) — Splinter Review
Rebased the patch. Thanks for the r+ Gavin!
Attachment #477258 - Attachment is obsolete: true
Keywords: checkin-needed
Whiteboard: [patchclean:1101]
Keywords: checkin-needed
Whiteboard: [patchclean:1101] → [patchclean:1101][checkin]
Whiteboard: [patchclean:1101][checkin] → [patchclean-enough:1101][checking-in]
Whiteboard: [patchclean-enough:1101][checking-in] → [patchclean-enough:1119][checking-in]
Whiteboard: [patchclean-enough:1119][checking-in] → [needs-update:1119]
Rebased patch.
Attachment #487370 - Attachment is obsolete: true
Whiteboard: [needs-update:1119] → [patchclean:1119][checkin]
Depends on: 601909
Blocks: 597460
Comment on attachment 491889 [details] [diff] [review]
[checked-in] rebased patch

http://hg.mozilla.org/mozilla-central/rev/0fa9ae503e4b
Attachment #491889 - Attachment description: rebased patch → [checked-in] rebased patch
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [patchclean:1119][checkin] → [patchclean:1119]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.