app-center icon indicating copy to clipboard operation
app-center copied to clipboard

SnapModel: toggle connections correctly

Open Feichtmeier opened this issue 3 years ago โ€ข 3 comments

Here the connections that are established for the corresponding snap are loaded

https://github.com/ubuntu-flutter-community/software/blob/8af4ad3dd648c42e240b2d50382f2df3eaea2f24/lib/store_app/common/snap_model.dart#L330-L345

I tried to toggle a connection on and off and get the connections for this snap again but load the ones that are established and not established but the not established / un-toggled connections were not discoverable (for me).

We've spoke about this on Telegram before @robert-ancell - could you look at this again and give a hint how to solve this?

Connect / disconnect works fine

https://github.com/ubuntu-flutter-community/software/blob/8af4ad3dd648c42e240b2d50382f2df3eaea2f24/lib/store_app/common/snap_model.dart#L304-L328

But currently the switches do nothing because toggling a connection off would remove them from the list and make them dissappear "forever" in the view.

Feichtmeier avatar Aug 31 '22 08:08 Feichtmeier

I think what you need is https://github.com/canonical/snapd.dart/pull/67 - then you can use _client.getConnections(filter: SnapdConnectionFilter.all).

robert-ancell avatar Sep 01 '22 00:09 robert-ancell

This might also help https://github.com/canonical/snapd.dart/pull/68

robert-ancell avatar Sep 01 '22 02:09 robert-ancell

Uh, thank you! I'll try this :)

Feichtmeier avatar Sep 01 '22 04:09 Feichtmeier