Closed
Bug 624092
Opened 15 years ago
Closed 15 years ago
Error in Thunderbird's javascript code - use of undefined object (SubscribeOnLoad() in chrome://messenger/content/subscribe.js)
Categories
(Thunderbird :: General, defect)
Thunderbird
General
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.3a3
People
(Reporter: jurko.gospodnetic, Assigned: jurko.gospodnetic)
Details
(Whiteboard: [patchlove])
Attachments
(1 file, 1 obsolete file)
|
1.06 KB,
patch
|
standard8
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
At one time I got an error message in Thunderbird's Error Console stating that an uninitialized 'serverMenu' variable is being used at line 255 of the chrome://messenger/content/subscribe.js module - function SubscribeOnLoad().
After reviewing the code I see how this can happen - this variable is initialized in one 'if (folder && folder.server instanceof Components.interfaces.nsISubscribableServer)' branch but is later used in the next 'if (!gServerURI)' branch independently of the first one. So if the program does not enter the first branch but enters the second one - you get this error.
Should be easy to
Reproducible: Always
Steps to Reproduce:
No need to reproduce this - it is obvious from the code how it can go badly.
Actual Results:
Code fails.
Expected Results:
Code runs on as expected.
My guess is that you should just move the:
var serverMenu = document.getElementById("serverMenu");
variable declaration in front of its current 'if (folder && folder.server instanceof Components.interfaces.nsISubscribableServer)' branch.
Comment 1•15 years ago
|
||
Can you make a patch and upload it here using the add an attachment link above ?
| Assignee | ||
Comment 2•15 years ago
|
||
Patch made in unified diff format with 8 context lines based on the:
chrome/messenger.jar/content/messenger/subscribe.js
file as found in the Thunderbird version:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
Unfortunately I have not taken the time to access your development source code repository or attempted to reproduce the problem manually, but the whole problematic procedure cca. 50 lines of code, easily readable and the problematic serverMenu variable is referenced only in a couple of places.
Hope this helps.
Best regards,
Jurko Gospodnetić
Updated•15 years ago
|
Attachment #503017 -
Flags: feedback?(bugzilla)
Comment 3•15 years ago
|
||
(In reply to comment #2)
Thanks a lot for providing a pseudo patch.
> Unfortunately I have not taken the time to access your development source
> code repository or attempted to reproduce the problem manually, but the whole
> problematic procedure cca. 50 lines of code, easily readable and the
> problematic serverMenu variable is referenced only in a couple of places.
could you do that so we could easily incorporate the patch in ? In the meantime I've requested dev feedback on your pseudo-patch.
Assignee: nobody → jurko.gospodnetic
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
| Assignee | ||
Comment 4•15 years ago
|
||
Sorry, but I just do not have the time to research & set up the full development environment and run the application from sources. It took me a while just to find the source file in one of the .jar files located in the distribution after seeing it referenced in an error message. I do not know directly how to even modify this code and still get it used by the application.
Reproducing the problem would require either understanding all the objects used in that part of code (which I am not versed in) or taking a time for a lot of clicking on the application until the bug just 'pops up'... Someone understanding Thunderbirds internal object structure could probably do this in a minute...
On the other hand, as I said before... the whole bug (variable getting used before initialization) is obvious when reading the code - so I do not think the developer will have any problem locating & fixing it.
Whether it is perhaps just a part of a larger logical bug and so whether a more general fix is needed - that I can not say... and that is a part I really do not have the time to find out.
Hope this helps.
Best regards,
Jurko Gospodnetić
Comment 6•15 years ago
|
||
(In reply to comment #5)
> Gary could you take over and carry on with this ?
Yup, coming soon.
Whiteboard: [patch love] → [has draft patch][patchlove]
Comment 7•15 years ago
|
||
Adapted from Jurko Gospodnetić's diff.
Attachment #503017 -
Attachment is obsolete: true
Attachment #505863 -
Flags: review?(bugzilla)
Attachment #503017 -
Flags: feedback?(bugzilla)
Updated•15 years ago
|
Attachment #505863 -
Flags: review?(bugzilla) → review+
Comment 8•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [has draft patch][patchlove] → [patchlove]
Target Milestone: --- → Thunderbird 3.3a3
Comment 9•15 years ago
|
||
Thanks for the bug report Jurko.
You need to log in
before you can comment on or make changes to this bug.
Description
•