snapd icon indicating copy to clipboard operation
snapd copied to clipboard

DT-576: GTK notification if app is refreshing

Open sergio-costas opened this issue 2 years ago • 11 comments

This MR integrates with https://github.com/snapcore/snapd-desktop-integration/pull/21 to show a Gtk window when a snap is locked because it is being refreshed and can't be launched yet.

It implements part of SD136

Thanks for helping us make a better snapd! Have you signed the license agreement and read the contribution guide?

sergio-costas avatar Sep 28 '22 17:09 sergio-costas

@mardy Oops... Yep, changed to CamelCase. Sorry O:-)

sergio-costas avatar Oct 03 '22 11:10 sergio-costas

@mardy BTW: I think that lines 62 to 69 should be removed, because both graphicalSessionFlow()and textFlow()functions wait for the inhibit to be unlocked. If I understand it correctly, the current code waits until the lock is removed, shows a notification, waits again for the lock to be removed (which, since it already is, is instantaneous) and removes the notification...

sergio-costas avatar Oct 03 '22 15:10 sergio-costas

@Meulengracht Done.

sergio-costas avatar Oct 06 '22 09:10 sergio-costas

@Meulengracht Me too :-)

Done.

sergio-costas avatar Oct 06 '22 09:10 sergio-costas

@mardy Can you review this, please?

sergio-costas avatar Oct 07 '22 09:10 sergio-costas

@Meulengracht Mmm... probably when I did a rebase from master without doing a pull previously :-(

I'll recheck all the change suggestions to ensure that all are applied.

sergio-costas avatar Oct 07 '22 11:10 sergio-costas

Ok, I was using echo refresh > /var/lib/snapd/inhibit/firefox.lock to simulate a refresh lock, but forgot the "-n" to remove the NL character at the end, so the HINT function didn't identify correctly the state. Taking this into account, the code is simpler.

sergio-costas avatar Oct 13 '22 15:10 sergio-costas

@mardy @Meulengracht There was a bug in the code: when the snap was locked and a Snapd-Desktop-Integration notification was shown, "snap run XXX" didn't wait until the app was unlocked. I fixed it in the last patch. Can you review it again when you have some spare time, please?

sergio-costas avatar Oct 17 '22 08:10 sergio-costas

@mardy Added three unitary tests.

sergio-costas avatar Oct 21 '22 15:10 sergio-costas

@mardy It seems that there is no access to DBus during the tests... Is there a way of fix this?

sergio-costas avatar Oct 21 '22 16:10 sergio-costas

Added three unitary tests.

sergio-costas avatar Oct 26 '22 11:10 sergio-costas

The changes in snapd-desktop-integration "required" for this MR are now available in latest/stable.

("required" because if snapd-desktop-integration isn't running, snap will behave like before).

sergio-costas avatar Dec 01 '22 14:12 sergio-costas

I changed the PR summary to match snapd conventions, which are <effected package dirs>|<effected components>|many: summary

pedronis avatar Dec 02 '22 16:12 pedronis

@pedronis Great cleanups! Thanks.

sergio-costas avatar Dec 09 '22 10:12 sergio-costas

@mvo5 should we mark this blocked as per discussion about preexisting issues?

pedronis avatar Dec 14 '22 13:12 pedronis

@mvo5 should we mark this blocked as per discussion about preexisting issues?

What preexisting issues?

sergio-costas avatar Dec 14 '22 13:12 sergio-costas