Closed Bug 119812 Opened 23 years ago Closed 23 years ago

javascript strict warnings in CookieViewer.js

Categories

(Core :: Networking: Cookies, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: bugzilla, Assigned: morse)

Details

Attachments

(1 file, 1 obsolete file)

When I remove a cookie from Cookie Manager Warning: reference to undefined property cookies[idx] Source File: chrome://communicator/content/wallet/CookieViewer.js Line: 173 build 20020111
Blocks: 106216
No longer blocks: 106216
I get both of these (this bug and 120277) at the same time. Duping up. *** This bug has been marked as a duplicate of 120277 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
I wish you wouldn't dup them. The symptoms are entirely different. What if I determine that one report is invalid and I fix the other. Do I close the bug report out as invalid or fixed? What if I have to reassign one of them to another person.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Morse: sorry. Some other owners prefer to dupe strict warnings into one patch. I won't do it again!
Am unable to reproduce. tever, can you reproduce this one?
getting this every time I delete a cookie from the Cookie Manager. And you do have strict warn on and everything?
Yes, I do have strict warn on. Is that "everything"?
please try this to reproduce: 1) use a fresh new profile 2) enable js strict warns 3) go to http://opasia.dk 4) open js console 5) open cookie manager 6) select of of the two cookies and press Remove Cookie 7) watch the js console... Warning: reference to undefined property cookies[idx] Source File: chrome://communicator/content/wallet/CookieViewer.js Line: 241
OK, now I can reproduce.
Not sure exactly why this is happening. When the CookieSelected() method of CookieViewer.js is entered, the value of selections[0] (i.e., the first element in the selections array) has a value greater than the number of elements in the cookie list. So where is this call to CookieSelected() occuring? It is happening in the DeleteSelectedItemFromOutliner() method in nsWalletTreeUtils.js. Specifically it is happening just after the following line is executed: box.rowCountChanged(0, table.length); This is to be expected. However if I dump out the value of the first element in the selections array just prior to this statement, it is a valid value. So it looks like some sort of synchronization problem. The easiest thing to do here is just add some bulletproofing to catch this lack of synchronization.
Attached patch Add bulletproofing (obsolete) — Splinter Review
alecf, sgehani, please review. Thanks.
Status: REOPENED → ASSIGNED
Target Milestone: --- → mozilla0.9.9
Comment on attachment 69689 [details] [diff] [review] Add bulletproofing let's put a dump() in there to encourage people to help you track it down....
Attachment #69689 - Attachment is obsolete: true
Does this out-of-sync stat cause loss of functionality? Would using a timeout be helpful here (i.e., setTimeout(<func>, 0))? Should we try and understand the underlying issue so that other clients could benefit?
Comment on attachment 69697 [details] [diff] [review] Added dump statement per reviewer's request sr=alecf
Attachment #69697 - Flags: superreview+
No, it doesn't cause loss of functionality. There is another pending call to CookieSelected() that will occur just after this one, and that one has a valid value. So it will perform the desired functions. It's not worth investigating the underlying cause at this time because we have bigger fish to fry.
Comment on attachment 69697 [details] [diff] [review] Added dump statement per reviewer's request r=sgehani
Attachment #69697 - Flags: review+
Patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
v 20020221
Status: RESOLVED → VERIFIED
If this bug was fixed in Feb 2002 why do I still get the dump message in Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826. "Tree and viewer state are out of sync! Help us figure out the problem in bug 119812D" If it really is fixed why not drop the dump message. By the way I got the message trying to delete a 2nd cookie from a site I had blocked when I deleted the first !
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: