android icon indicating copy to clipboard operation
android copied to clipboard

Add notifications for status of manual reconnect

Open otwacam opened this issue 2 weeks ago • 2 comments

Currently when performing a manual reconnect from the Preferences -> Connection view the app currently gives no immediate feedback for the outcome of the attempt and requires navigating elsewhere to determine the result and possible error.

The manual reconnect will now:

  • Raise a "Reconnecting" snackbar notification when the "Reconnect" button is clicked
  • Raise a "Connected" snackbar notification if the action is successful
  • Display a dismissable error alert if the action fails and gives the option to copy the error message to the clipboard
Reconnecting Reconnect_success Reconnect_error

otwacam avatar Dec 08 '25 19:12 otwacam

Nice idea - does the reconnection process continue if the user navigates off that view? Looking at the code, I'd be mildly concerned that the context gets cancelled, so not sure what state that'd leave it in.

Presumably we'd want the snackbar to appear.... only when the status screen is visible?

growse avatar Dec 09 '25 14:12 growse

I went and tested this and the primary reconnection functionality works the same as currently where the process continues even if the user navigates away. With a timeout of 10 seconds the reconnect will continue regardless of the screen the user is on and will timeout when the value has been reached.

There was an issue with the notifications however where navigating back caused errors when trying to display the notifications after the reconnect process completes due to the Activity no longer existing. I have added some checks so at the point of raising the notifications if the Connection screen is not visible or the Activity has been destroyed then it will not try to show them. If there is a better way you can think of please let me know.

Yes, I was thinking that the snackbar should only be visible on the Connection screen where we are triggering the process and should not be visible if the user navigates away. If the user navigates forward to the Status screen the endpoint connection state is already shown and updated in realtime.

otwacam avatar Dec 09 '25 23:12 otwacam