canonical / pebble

Take control of your internal daemons!
GNU General Public License v3.0
136 stars 51 forks source link

fix!: remove warnings #443

Open benhoyt opened 4 days ago

benhoyt commented 4 days ago

Pebble has never used the warnings system or recorded any warnings. It's getting in the way, so remove it (for one thing, before this PR it means a state lock/unlock on every request to get the warnings summary -- which is always 0).

Warnings (inherited from snapd) assume a single client, which isn't true and doesn't make a lot of sense for Pebble: they have a single lastShown timestamp (on the server) for when they were last shown to the (single) client, whereas notices aren't marked as "shown" on the server. Each server response included pending warnings (pending means not shown or having a lastShown earlier than repeatAfter ago).

This PR:

Separately (or in this PR if desired?) we could reinstate the pebble warnings command to use notices of type=warning and save the last warning timestamp locally on the client. But I'm not sure that gains much over the user just using pebble notices --type=warning.