Page MenuHomePhabricator

Terminal subcategory displays "undefined undefined: null" in Safari
Closed, ResolvedPublic

Description

Author: fastfission

Description:
On the new subcategory tree function, instead of displaying "nothing found" when one gets to the final subcategory in a tree,
Safari displays "undefined undefined: null" in a large red font. See screenshot at URL above.

I don't have a clue how the subcategory tree function works but this looks pretty broken. I know Safari isn't the most popular
browser but it seems perhaps indicative that this isn't the ideal way to do whatever it is it is trying to do. (Why doesn't each
node figure out if it has children or not when it is displayed and then just not allow you to expand it if it doesn't? Even the
"nothing found" looks a little amateurish IMO.)


Version: unspecified
Severity: normal
OS: Mac OS X 10.4
Platform: Macintosh
URL: http://en.wikipedia.org/wiki/Image:Subcategory_bug_in_Safari.png

Details

Reference
bz7219

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:22 PM
bzimport set Reference to bz7219.
bzimport added a subscriber: Unknown Object (MLST).

The reasone that it doesn't count children up fron is simple: it would require a
lot of database queries, the reult of which would rarely be used. I'm not aware
of any way to do this nice and fast.

Why safari displays "undefined" there I don't know... and I don't have safar to
test it. I'll ask around.

This appears to be a safari bug - "undefined undefind" refers to the status and
statusText fields of the XMLHttpRequest object, which *must* always be
available, as per specification.

I have found reports about Safari sometimes not setting these fields, but not
about this specific case - it seems this is triggered when the response from the
server is empty. I'm currently trying to find a workaround - I can't think of a
good way right now, though.

Does this happen for *all* "terminal" subcategories for you? Always? Does it
sometimes happen in other cases as well? Especially, check this: if you expand a
category node, then reload the page, then expand the same node again - does that
trigger an error?

For reference:
http://www.bitterpill.org/bp/2005-06/safari-xmlhttprequest-undefine.html
describes a problem related to If-Modified-Since caching, with the same symptoms.

fastfission wrote:

I've seen it in all terminal subcategories, even if I do many of them at the same time. I tried the reloading-and-clicking
and it does the same thing. Even if I open a node and then close it and open it again. It seems to strike-out in Safari each
time.

I can see why not to look for children ahead of time; and I imagine keeping a static childcount for any individual category
would take some substantial re-working of the way things are currently done.

I have committed a workaround in r16377. I hope that fixes the problem, I don't
have Safari to test.

The workaround is active on wikipedia now, please check if the problem has gone
away. You can reopen the bug if it's not OK.