gs-update-monitor: Delay update time with larger random interval
It has been reported that some mirroring infrastructure sites
are suffering traffic spikes from update monitor from 6 to 7am.
This commit tries to resolve this issue by adding a randomized
hour parameter in [0, 6). And also, fallback to previous logic
if it has not been updated for 2 days or longer. GDateTime
methods are used to get datetime difference instead of handling
year, month and day values manually.
A more sophisticated strategy might be necessary if this problem
still exists after this commit, to both let users get updates
automatically, and not stressing infrastructure.
DT-779: show update notifications on startup (Core22)
Currently, snap-store remembers if it has shown a notification
for an specific update. This means that if the user closes the
notification, it won't be remembered that there are pending
updates.
This patch resets the timestamps during launch to ensure that,
after login, the user will always be notified if there are
pending updates.
The autostart is enabled only when the "ubuntu-software" app
from the "snap-store" snap is run, but not if the "snap-store"
app is run. This was quite hidden because the icon in the dock
is for the "ubuntu-software" app.
This PR fixes this by setting the autostart for both apps.