git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb.js: Harden setting blamed commit info in incremental blame

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 25, 2009, 20:55 UTC
Message-ID
<200911252155.59318.jnareb@gmail.com>
In-Reply-To
<200911251536.08993.jnareb@gmail.com>
On Wed, 25 Nov 2009, Jakub Narebski wrote:
Show 20 quoted lines
> On Wed, 25 Nov 2009 05:01, Stephen Boyd wrote:
> > Jakub Narebski wrote:
> > >
> > > Debugging this is serious PITA.  After fix below it appears that this bug
> > > is some intermittent bug, depending on XMLHttpRequest timing.  It more
> > > often than not (at least when I tried to debug it using build-in IE8
> > > debugger) works correctly for the folowing files: README, GIT-VERSION-GEN,
> > > revision.c (once even it did fail when first running for given file, and
> > > then running correctly when reloading from debugger; fun it is not).
> > >
> > > It does consistently fail for gitweb/gitweb.perl... but when I tried
> > > to debug it IE8 would hang up when trying to use debugger (with around
> > > 600MB available RAM).  Perhaps somebody else would have more luck...
> > 
> > Interesting. I don't have time to look into this until early December, 
> > but if it's still around then I'll take a look. I wonder if IE6 or IE7 
> > works (I don't think everyone is on version 8 yet).
> 
> Well, the one time I was able to run debugger (F12, select 'Script', select
> 'gitweb.js') with error occurring
The error was "Unspecified error", char:2 in the mentioned line
Show 8 quoted lines
> and without IE hanging (for README file) it did show an error for the
> following line: 
> 
>   if (xhr.readyState === 3 && xhr.status !== 200) {
> 
> When I checked 'xhr' object, it has "Unknown error" as contents of 
> xhr.statusText field and as contents of xhr.status (sic!), which should
> be a number: HTTP status code.

It was 'Unspecified error.' shown in xhr watch. Accessing xhr.status causes an error.

This might be cause by the fact that xhr (XMLHttpRequest object, or as IE8 shows it in JScript debugger DispHTMLXMLHttpRequest object) is not fully initialized, or something; gitweb.js calls handleResponse() also from a timer, to work around the fact that some web browsers onreadystatechange handler is called only once for each state, and not as soon as new data is available from server.

Longer term solution would be to use onprogress handler if it is available; if it is available we don't need trick with calling handleResponse from timer, as XMLHttpRequest 2.0 proposed specification ensures calling callback as soon as new data is available.

Short term solution would be to wrap access to xhr.status in try ... catch block for IE8... although I am a bit reluctant to implement this workaround bugs in IE8.

-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: Junio C Hamano
Message 19 of 41 in “jn/gitweb-blame fixes”
  1. 0/2 jn/gitweb-blame fixesStephen Boyd, Nov 19, 2009
  2. 1/2 gitweb.js: fix null object exception in initials calculationStephen Boyd, Nov 19, 2009
  3. Jakub NarebskiNov 19, 2009
  4. Stephen BoydNov 19, 2009
  5. 2/2 gitweb.js: use unicode encoding for nbsp instead of html entityStephen Boyd, Nov 19, 2009
  6. Jakub NarebskiNov 19, 2009
  7. Stephen BoydNov 20, 2009
  8. 2/2 gitweb.js: fix padLeftStr() and its usageStephen Boyd, Nov 25, 2009
  9. Jakub NarebskiNov 19, 2009
  10. Stephen BoydNov 20, 2009
  11. Stephen BoydNov 20, 2009
  12. Jakub NarebskiNov 21, 2009
  13. Jakub NarebskiNov 21, 2009
  14. gitweb.js: Harden setting blamed commit info in incremental blameJakub Narebski, Nov 25, 2009
  15. Nanako ShiraishiNov 25, 2009
  16. Jakub NarebskiNov 25, 2009
  17. Stephen BoydNov 25, 2009
  18. Jakub NarebskiNov 25, 2009
  19. Jakub NarebskiNov 25, 2009
  20. Junio C HamanoNov 25, 2009
  21. Jakub NarebskiNov 25, 2009
  22. Junio C HamanoNov 26, 2009
  23. Jakub NarebskiNov 26, 2009
  24. gitweb: Make linking to actions requiring JavaScript a featureJakub Narebski, Nov 26, 2009
  25. Junio C HamanoNov 26, 2009
  26. Jakub NarebskiNov 26, 2009
  27. Junio C HamanoNov 27, 2009
  28. Jakub NarebskiNov 27, 2009
  29. Junio C HamanoNov 27, 2009
  30. Junio C HamanoDec 1, 2009
  31. Jakub NarebskiDec 1, 2009
  32. 1/2 gitweb: Make linking to actions requiring JavaScript a featureJakub Narebski, Dec 1, 2009
  33. 2/2 gitweb: Add link to other blame implementation in blame viewsJakub Narebski, Dec 1, 2009
  34. Stephen BoydDec 7, 2009
  35. Stephen BoydDec 7, 2009
  36. PATCH/RFC] gitweb.js: Workaround for IE8 bugJakub Narebski, Dec 8, 2009
  37. Stephen BoydDec 8, 2009
  38. Jakub NarebskiDec 8, 2009
  39. Jakub NarebskiDec 8, 2009
  40. Stephen BoydDec 9, 2009
  41. Stephen BoydNov 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.