Opened 8 years ago

Closed 7 years ago

#5514 closed Enhancement (fixed)

Enhanced network status

Reported by: rb07 Owned by: jordan
Priority: Normal Milestone: 2.83
Component: Qt Client Version: 2.82
Severity: Normal Keywords:
Cc:

Description

In the context of using Transmission-Qt as the GUI for a transmission-daemon (i.e. remote session), the icon on the status bar that shows network, or communications, status has not worked for a long time (perhaps a change in Qt broke it.)

The problem is that the status shows "server is responding" for ever, nothing makes it change because the time based implementation doesn't work (as long as the application keeps trying to communicate, Qt emits the dataReadProgress() signal with 0 bytes read, 0 bytes total): http://imageshack.us/a/img594/7222/3iji.png

I fixed that problem by taking into account the error status.

But the time based implementation can be further improved. The error status can be shown in 2 ways: changing the icon when it happens, which is usually much faster than the current waiting; and by showing the actual error message: http://imageshack.us/a/img443/8696/kaxf.png

In the attached patch I don't even show the first line (the original line), the image is just an example I got with my first version. I don't show the time line because when the error occurs, the icon changes in about 1 sec (the test was stopping the daemon), and the line keeps showing "server is responding", then the time since last response, and finally after several minutes elapsed "server is not responding".

Attachments (2)

003-network-status.diff (5.2 KB) - added by rb07 8 years ago.
004-network-status.diff (1.1 KB) - added by rb07 7 years ago.
Add message on the tray icon tool-tip. Adds recovery.

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by rb07

comment:1 Changed 8 years ago by jordan

  • Milestone changed from None Set to 2.90
  • Status changed from new to assigned

comment:2 Changed 8 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

Looks good.. patched in r14213.

comment:3 Changed 8 years ago by livings124

  • Milestone changed from 2.90 to 2.83

comment:4 Changed 8 years ago by rb07

  • Resolution fixed deleted
  • Status changed from closed to reopened

I just noticed yesterday that when the icon shows an error with the remote session communication, the tool-tip on the tray icon still showed the last upload speed.

Corrected on the additional patch attached.

comment:5 Changed 7 years ago by rb07

The last patch doesn't correct the frozen tool-tip.

Looks like refreshTrayIcon() is not being called when the daemon stops responding. Perhaps calling it when the error is (first) detected needs to be added to the patch.

Changed 7 years ago by rb07

Add message on the tray icon tool-tip. Adds recovery.

comment:6 Changed 7 years ago by rb07

W.r.t. tray tool-tip: Latest additional patch (i.e. both are needed) is tested and working.

Bonus: Added new functionality, recovery from network error.

Now when the communication is lost, the list of torrents is cleared (the "model" in Qt terms), afterwards when the communication to the daemon recovers the list is current (i.e. no more duplicated, or wrong information displayed -- caused by the id renumbering when the daemon starts).

Last edited 7 years ago by rb07 (previous) (diff)

comment:7 Changed 7 years ago by jordan

Tweak added in r14261.

I rearranged the call order a little bit relative to your 004-network-status.diff patch because it seemed strange to update the tray icon as a side-effect of calling updateNetworkIcon().

Instead, r14261 updates both icons when the myNetworkError flag changes.

comment:8 Changed 7 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:9 Changed 7 years ago by rb07

  • Resolution fixed deleted
  • Status changed from closed to reopened

Glitch with the "recovery" part:

Every hour the daemon expires the http session-id, this produces a NetworkReply::UnknownContentError which, thanks to my change, clears the list of torrents for a short while (3 sec to be precise). In other words, the "recovery" is kicking once every hour, during normal operation.

I'm testing this change:

+    myNetworkError = (code != QNetworkReply::NoError)
+                  && (code != QNetworkReply::UnknownContentError);

of course that is not using Jordan's change (i.e. const bool haveError = ...)

I said testing because I saw this happen while adding a torrent, deleting a torrent, and it was not something that could be duplicated. Also some times it didn't clear the whole list, just most of it. So I'm looking if there is anything else triggering the "recovery" (an expected one: returning from hibernate, which first produces UnknownNetworkError, some times, not always, then the expired session).

comment:10 Changed 7 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed

Updated in r14273.

Note: See TracTickets for help on using tickets.