Hold refresh snapd api time in the past error not handled

Hello, I implemented a snap that calls the snapd api to hold refresh on given snaps, this is the json structure:

{ “action”: “hold”, “snaps”: [“moon-buggy”] “hold-level”:“general” “time-duration”:“2022-02-28T07:25:40.20Z” }

This time is in the past but the error is not handled, is it going to be?

Hello @ccaperna. Thanks for reaching out. I don’t think it will because it’s a bit problematic for an API to validate an instant since it can expire immediately after being validated so the daemon can never assume that the instant is in the future. What do we do if we accepted the request but the instant passes before placing the hold internally? Since we can’t provide any guarantees anyway, it’s more consistent to always accept and place the hold since it’s not really invalid, just expired. On the other hand, the snap tool can validate and return an error because it takes in a duration instead of a time instant. Hope that helps.

Thanks, Miguel