canonical / pebble

Pebble is a lightweight Linux service manager with layered configuration and an HTTP API.
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
146 stars 54 forks source link

fix(daemon): small refactor of notices api #337

Closed olivercalder closed 10 months ago

olivercalder commented 10 months ago

Most importantly, wait to lock the state until after the optional duration has been parsed, in case an error occurs. Also, moves the types query parsing/sanitization into its own function, since this cleans up the GET notices handler and better matches future handling of user ID filtering.

These changes were requested by @Meulengracht while reviewing the PR to merge the pebble notices API into snapd: https://github.com/snapcore/snapd/pull/13364