Opened 12 years ago

Closed 12 years ago

#2307 closed Bug (fixed)

%nan on web interface while verifying

Reported by: godsyn Owned by: kjg
Priority: Normal Milestone: 1.74
Component: Web Client Version: 1.73
Severity: Normal Keywords:
Cc:

Description

I have two large torrents that display %nan tested when verifying local data. If left to their own for long enough, it clears. See attached image.

http://i25.tinypic.com/5tur6t.png

Transmission 1.73 (8831)

Attachments (1)

Untitled.png (1.9 KB) - added by godsyn 12 years ago.
%nan tested

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by godsyn

%nan tested

comment:1 Changed 12 years ago by kjg

  • Component changed from Transmission to Web Client
  • Owner set to kjg

comment:2 Changed 12 years ago by charles

Looking into this a little bit... I haven't figured out where NaN is coming from, but maybe kjg or bmw will look at these snippets and see the culprit.

The text in question comes from torrent.js:

// 'Verifying local data (40% tested)'
c = 'Verifying local data (';
c += Math.roundWithPrecision( 100.0 * this._recheckProgress, 0 );
c += '% tested)';

this._recheckProgress comes straight from RPC in torrent.js:

this._recheckProgress       = data.recheckProgress;

which comes from libtransmission/rpcimpl.c:

else if( tr_streq( key, keylen, "recheckProgress" ) )
    tr_bencDictAddReal( d, key, st->recheckProgress );

which comes straight from tr_torrentStat():

    s->recheckProgress = s->activity == TR_STATUS_CHECK
                       ? 1.0 -
                         ( tr_torrentCountUncheckedPieces( tor ) /
                           (double) tor->info.pieceCount )
                       : 0.0;

lastly, Math.roundWithPrecision comes from common.js:

Math.roundWithPrecision = function(floatnum, precision) {
    return Math.round ( floatnum * Math.pow ( 10, precision ) ) / Math.pow ( 10, precision );
};

These last two parts seem like the most suspicious to me. Actually I'm not sure why it makes sense to use Math.roundWithPrecision( anyNumber, 0 ) since it's the same as "Math.round((anyNumber*1)/1)"

comment:3 Changed 12 years ago by kjg

  • Milestone changed from None Set to 1.74
  • Resolution set to fixed
  • Status changed from new to closed

r8876 should fix this. recheckProgress was not being requested by the web interface for the initial torrent load.

Note: See TracTickets for help on using tickets.