Opened 8 years ago

Closed 7 years ago

#3708 closed defect (wontfix)

Fix "None" entries in relay list

Reported by: karsten Owned by:
Priority: Medium Milestone:
Component: TorStatus Version:
Severity: Keywords:
Cc: jfehr@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Wendy reports:

A minor bug: attempting to sort the list by Bandwidth (desc) shows "None
KB/s" at the top of the list, and "0 KB/s" at the bottom, so I don't see
a way to show the highest bw nodes at the top. Where does "None" come
from? Uptime also has both "None d" and "0 d."

I saw this problem, too, but now it's gone. I could imagine it has to do with the database schema being populated more. Any idea where the "None" values come from?

Child Tickets

Change History (3)

comment:1 in reply to:  description Changed 8 years ago by cypherpunks

Replying to karsten:

Wendy reports:

A minor bug: attempting to sort the list by Bandwidth (desc) shows "None
KB/s" at the top of the list, and "0 KB/s" at the bottom, so I don't see
a way to show the highest bw nodes at the top. Where does "None" come
from? Uptime also has both "None d" and "0 d."

I saw this problem, too, but now it's gone. I could imagine it has to do with the database schema being populated more. Any idea where the "None" values come from?

That's exactly right. "None" is currently the default value for fields with null values. In this case, "None" is displayed for fields gathered from the descriptor table such as bandwidth, uptime, contact, and published. The confusing part about this is that when "DirPort" is similarly "None", this means that the relay has opted not to specify a DirPort. In templates, Django provides a way to specify default values in the case of null values, which seems like a good solution to this problem.

The sorting problem seems somewhat postgres specific: by default, postgres displays null values first in descending sorts. In postgres' flavor of SQL, this can be remedied by appending a 'NULLS LAST' to a query with an 'ORDER BY'. In Django, this could be done with an '.extra' query using the 'COALESCE' function. However, we shouldn't have more than just a few relays on the index page with null descriptor fields.

comment:2 Changed 8 years ago by jfehr

Cc: jfehr@… added

comment:3 Changed 7 years ago by karsten

Resolution: wontfix
Status: newclosed

We stopped maintaining TorStatus long ago in favor of Onionoo/Atlas. This problem is TorStatus-specific, so we won't work on it. Closing.

Note: See TracTickets for help on using tickets.