Skip to main content

register_push_subscription_conditional

Function register_push_subscription_conditional 

Source
pub fn register_push_subscription_conditional<B>(
    dispatcher: &mut Dispatcher<B::CallerCtx>,
    backend: Arc<B>,
) -> Result<(), RegistrationError>
Expand description

Opt PushSubscription/set in to draft-ietf-jmap-conditional-02 (ifUnchangedBy and atomic), after register_push_subscription_handlers (docs/design/DECISIONS.md decisions 1, 16 and 17).

Attaches SetSupport for PushSubscription to the registered PushSubscription/set; it does not re-register it, so extension validation in the backend’s create and update keeps running, inside the scope backend opens (ConditionalBackend::begin_set). The scope has no account (SetScopeRequest::account_id is None): key it by the caller’s credentials. The dispatcher reads preconditions through PushSubscription/get, so a pointer to url or keys is forbidden (conditional-02 §9.1), and ifInState stays ignored (RFC 8620 §7.2.2; /get has no state).

§Errors

RegistrationError::NotRegistered when PushSubscription/set is not registered yet.