Ticket #260 (new defect)

Opened 3 years ago

Last modified 3 years ago

Disconnection progress dialog prevents cancelling other progress

Reported by: alamaison Owned by: alamaison
Priority: major (affects peripheral workflow) Milestone: 0.9.x Bug sprint
Component: host folder Version: 0.7.4
Keywords: Cc:

Description

Once clicking 'Close session', the window blocks until that operation is complete. That means that, if the operation displays the progress dialog that shows the pending tasks, the user isn't able to cancel those tasks using their corresponding progress dialog (for example, the file copy progress dialog).

Change History

comment:1 Changed 3 years ago by alamaison

In [270067f372f7e11766f5abd0fdd0b41c8d8b254a/swish]:

Make all uses of a session reserve a ticket first.

In 45982a892ddc5aea23cc7b26a00b4937c3a8a3b8 the session_pool started handing out non-copyable authenticated_sessions references, instead of shared_ptr<authenticated_session>s, so that it can guarantee a session would be disconnected when remove_session is called. As a result, when the user clicks 'Close session', any remaining uses of that session would crash Explorer.

This commit reworks the session management so that all session uses register their interest in the session by reserving it and receiving a ticket for that reservation. As long as they hold the ticket, they may use the session without fear that it will be disconnected. The allow this, the 'Close session' command is changed to wait for all outstanding tickets to be released before disconnecting the session.

A part of the implementation would benefit from future work, but will do for now: While the disconnection is occurring, the progress dialog it displays blocks the window, which prevents the user cancelling the tasks holding tickets by making their UI unresponsive. See #260.

Closes #85

comment:2 Changed 3 years ago by alamaison

In [270067f372f7e11766f5abd0fdd0b41c8d8b254a/swish]:

Make all uses of a session reserve a ticket first.

In 45982a892ddc5aea23cc7b26a00b4937c3a8a3b8 the session_pool started handing out non-copyable authenticated_sessions references, instead of shared_ptr<authenticated_session>s, so that it can guarantee a session would be disconnected when remove_session is called. As a result, when the user clicks 'Close session', any remaining uses of that session would crash Explorer.

This commit reworks the session management so that all session uses register their interest in the session by reserving it and receiving a ticket for that reservation. As long as they hold the ticket, they may use the session without fear that it will be disconnected. The allow this, the 'Close session' command is changed to wait for all outstanding tickets to be released before disconnecting the session.

A part of the implementation would benefit from future work, but will do for now: While the disconnection is occurring, the progress dialog it displays blocks the window, which prevents the user cancelling the tasks holding tickets by making their UI unresponsive. See #260.

Closes #85

Note: See TracTickets for help on using tickets.