Re: [Jmap] Feedback on the quota draft

Bron Gondwana <brong@fastmailteam.com> Wed, 04 March 2020 10:44 UTC

Return-Path: <brong@fastmailteam.com>
X-Original-To: jmap@ietfa.amsl.com
Delivered-To: jmap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 066883A0C16 for <jmap@ietfa.amsl.com>; Wed, 4 Mar 2020 02:44:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=TeO6Iwpa; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=nJs6+tgq
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5SWQa20kPkjr for <jmap@ietfa.amsl.com>; Wed, 4 Mar 2020 02:44:53 -0800 (PST)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 986243A0C20 for <jmap@ietf.org>; Wed, 4 Mar 2020 02:44:52 -0800 (PST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id CD96F5FA for <jmap@ietf.org>; Wed, 4 Mar 2020 05:44:48 -0500 (EST)
Received: from imap7 ([10.202.2.57]) by compute1.internal (MEProxy); Wed, 04 Mar 2020 05:44:48 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type; s=fm2; bh=dhjcWzt KqRJjTWOHlOhQlL5TYM0oTy79X086j0Ukf0A=; b=TeO6IwpaxeREOWz1yJBJtY8 191DX42R8U5LMZkggENw4JsTGsDzurjeEw53aie5LhpP92oL0wpY55+TfolgKFVn akzm1Ap8y7wkI+4F1DKKmjtmMFNia4moQ31gPzNfyd1oaY6zgIbho9T9RglOocTC 5xKM4eNobESnhSAVEu9PQUVabQndyR2IYgcezvC7x5a05OpEfQVCbJC9ZuNV4qWi e5Ao2JU9tu9+kAgaPFyqhFUHQvxohrewaWYXJ3d1NlPDQoRBwiDMqhE2nIBo9M9F HqioTYEte64QMu4oQWKOQbI0/1U61Lg01gTuuJlFu3hWIV4oJGjac2o2Ots8s1Q= =
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dhjcWz tKqRJjTWOHlOhQlL5TYM0oTy79X086j0Ukf0A=; b=nJs6+tgqthUkCkBl8ziFxt qX300tP5SAq5X0v9ZkskiFtGP7LuZbtGRU+qOMiltZ0wcBcI4sPOMPwjdkezvGSq AQ8oo6vtPAGcsYI8f1NrW+lEAmafe9FvLTG3+lI51zLCANVDISukME5v9YWMnTyD xWTCd+iz0xYyH9LqtSzt35H/ykOPCn6KDKQcHIF1iLuDP2nLufi/14kV9DisdY3l e3ptChj9AARZf/BnhQq1eQdel4HDWWeQMWvLygcVNUqbgz97yZwMhJm1fZiX5Q1A Imjhcr3ui4WWoFIknewy9mHmUd0dnd4PSgxiZWm4jvCSLzXlz52vqfjd5yfs8/JQ ==
X-ME-Sender: <xms:oIZfXhXd8q5hjLBFJkbHh2EAWXGtrA5oAPOQOipt3CtcrWUmp5PDqQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddtkedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerreejnecuhfhrohhmpedfuehrohhnucfiohhnugifrghnrgdfuceosghrohhnghes fhgrshhtmhgrihhlthgvrghmrdgtohhmqeenucffohhmrghinhepihgvthhfrdhorhhgpd hgihhthhhusgdrtghomhdpfihikhhiphgvughirgdrohhrghenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsrhhonhhgsehfrghsthhmrghilh htvggrmhdrtghomh
X-ME-Proxy: <xmx:oIZfXniJt8e_5AOd1yY-ZolPm3P0fmaGj64fHwriB08F7qRF1SeMtA> <xmx:oIZfXnFjjMCjEnpMO1UkNlfHs68XsqK34M1vcIgQGOXIOhAtbsnRYw> <xmx:oIZfXlIBZrpk5RB4DInXrq0yAL8sqUPsCFIltLHwXOFW_xYuUVfuGA> <xmx:oIZfXlXlSorKkAXpyOO003xLCoNZKrW0KzVrAk-vqgNELRKSoOb2hw>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3727A180091; Wed, 4 Mar 2020 05:44:48 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.7-986-gfc2d493-fmstable-20200304v3
Mime-Version: 1.0
Message-Id: <03a055f8-7ab3-44c8-b1cd-ccd51ed967fe@dogfood.fastmail.com>
In-Reply-To: <Mime4j.3.58c3e338a4b2000c.170a44777c3@linagora.com>
References: <Mime4j.3.58c3e338a4b2000c.170a44777c3@linagora.com>
Date: Wed, 04 Mar 2020 21:44:53 +1100
From: Bron Gondwana <brong@fastmailteam.com>
To: jmap@ietf.org
Content-Type: multipart/alternative; boundary="bab3457cbd3d4ab9aa161ec3a1f46890"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/uzo0tXzPY2ka8eBEe3IuEhVc_zw>
Subject: Re: [Jmap] Feedback on the quota draft
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: JSON Message Access Protocol <jmap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jmap>, <mailto:jmap-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap/>
List-Post: <mailto:jmap@ietf.org>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jmap>, <mailto:jmap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Mar 2020 10:44:57 -0000

Hi René,

Thanks for updating the draft! I'm about to hop on a plane and then I'll be on holiday for a couple of weeks - so just brief responses now! I've flagged this message to get back to when I'm working again.

Responses inline.

On Wed, Mar 4, 2020, at 17:41, René CORDIER wrote:
> Hi all,

> First of all, I would like to apologize for the time spent on this. I will try to fix comments faster in the future.

> Then, I am happy to say that I finally released the new draft version of JMAP quotas specs. Please have a look at the ietf tracker: https://datatracker.ietf.org/doc/draft-ietf-jmap-quotas

> I also did a github PR with the code change: https://github.com/jmapio/jmap/pull/318

> I tried to answer inline below as well to the feedback mashup generously made by Bron last time. Please don't hesitate to have a look.

> I would like to add an extra note as well, regarding the "quotaIds", it made little sense to add a field in "Mailbox" object indeed. I moved it as a property of the additional account's capability "urn::ietf::params::jmap::quota", as I think it makes more sense to have the quotas bounded to the account.

> I would like to discuss an other idea as well (that is not represented in this draft). Some properties seem likely to be repeated many times. I thought of adding a new Object for that, called "QuotaResource", that would be defined by a "name", "resourceType", "warnLimit", "softLimit", "limit" and "scope". Probably we want those to be the same for a group of users or all users, repeating it for each Quota sounds redundant? Something like that:


> "QuotaResource": {
>  "id": "re01",
>  "name": "normal user quota resource",
>  "resourceType": "count",
>  "warnLimit": 1600,
>  "softLimit": 1800,
>  "limit": 2000,
>  "scope": "account"
> }


> "Quota": {
>  "id": "qu01",
>  "quotaResourceId": "re01",
>  "used": 1056,
>  "name": "bob@example.com",
>  "description": "Personal account usage",
>  "datatypes": [ "Mail", "Calendar" ]
> }

> With maybe methods like /get, /set, /query ?

> Do you feel like it could be a good idea? Or does it make the all thing too complex and unnecessary?


I think it's probably too complex - but maybe others disagree. I don't feel super strongly about it so long as there's clear guidance on how to use it.

> Cheers,


> Rene.

> Le 20 novembre 2019 18:20, de brong@fastmailteam.com

>> Hi,
>> 
>> This is a combination of feedback collected from the meeting yesterday as well as my own suggestions! These suggestions only come with my own personal weight, and are not a "you must", they are an "I suggest" - please feel free to offer counter proposals or even outright rejections of my suggestions, there is no "chair weight" attached.
>> 
>> With that said, here's the suggestions :)
>> 
>> *Scope*
>> 
>> I'm not sure if there's any point to it, but so long as it can be *null* (which might be the same thing as "account") then I don't see a problem in having it available for those who want it.
>> 
>> I would just call the key "scope" rather than "usedScope". I don't see the point of putting different scopes on it, that seems unworkable. Instead, if you have quotas in multiple scopes I would expect a quota entry per scope with the amount that was used and the limit - e.g. "you're using 400Mb of 1Gb account quota, and your domain is using 34Gb of 100Gb allocated to the domain" - there's no point having "you're using 400Mb of your domain's 100Gb", because your domain could be using 99.9Gb and you'd have no way to see - so the "limit" needs to be the total minus what everyone else is using to be meaningful for calculating what you can do.

> 
> Agreed, one scope is simpler and more logical.

>> 
>> *Datatypes*
>> 
>> At the moment there's no way to tie datatypes to quotas. I would like to add an array of datatypes to each object (example below). As an example, you may have a different quota for Calendars than for Mail - or they may be shared. This is somewhat different from scope (server, domain, user, ...).

> 
> I liked that idea. Allows to apply Quota to more than just mails, so to other defined jmap objects defined by the specs, or even custom server ones.

>> 
>> *Quota/query*
>> 
>> At the moment the only way to get the list of quotas is "Quota/get#ids: null". I think in the interests of consistency we should allow a /query as well (probably don't need a /queryChanges, just have a canCalculateChanges; false, but we could allow that too if a server finds it easy with their general model).

> 
> I did add the "/query", and also the "/queryChanges". I don't have a strong opinion on this but maybe it can be useful for a server to have "/queryChanges" too.

>> 
>> *Quota/changes*
>> 
>> Like with Mailbox/changes - I could see value in having a updatedProperties which can be either null or a list of properties, such that you could issue:
>> 
>> [["Quota/changes", { "sinceState": ... }, "1"],
>>  ["Quota/get", { 
>>  "#ids": { "resultOf": "1", "name": "Quota/changes", "path": "/updated" }, 
>>  "#properties" : { "resultOf": "1", "Quota/changes", "path": "/updatedProperties" },
>> "2"]]
>> 
>> Which might only need to fetch the "used" most of the time.

> 
> I agree that "used" is probably gonna changed a lot compared to other fields, and that we are probably most interested by this field on a regular basis. 

>> 
>> *Push*
>> 
>> There should be a nod towards Push and mention that Quota state changes are pushed like other state changes.

> 
> +1

>> 
>> *Description*
>> 
>> Do we need to provide for both a short "name" and a longer "description" field on each quota?

> 
> +1

>> 
>> *Soft limits*
>> 
>> Does anybody care about soft vs hard limits? Soft limit being "you won't be blocked, but you'll be told off any maybe charged more", hard limits being "your changes will be rejected". Should we have an optional second limit field in the spec?
>> 
>> Something of this sort was raised on mailing list by John van der Kamp - in fact he talked of 3 levels. Perhaps they could be something like:
>> 
>> warnLimit
>> softLimit
>> limit
>> 
>> Where obviously warnLimit and softLimit are optional (and must each be lower than the next level up). This is more complexity, but it's optional complexity at both ends: servers don't need to set them, and clients don't need to display them.

> 
> +1

>> 
>> *Resource Types*
>> 
>> The IMAP quota draft defines three types of resources for quotas, and also a registry where more can be described. The initial types are "STORAGE" (units 1024 octets), "MESSAGE" (number of individual emails) and "MAILBOX" (number of mailboxes). It maybe viable to use the same registry.
>> 
>> Of course, then you get issues like what should you call it for Calendar or Addressbook? Should the limits be given DAVish names like "COLLECTION" and "RESOURCE" such that MESSAGE becomes "RESOURCE" and "MAILBOX" becomes "COLLECTION"? in JMAP quotas?
>> 
>> Also: should we do storage in bytes, or do 1024 octets for our storage numbers in JMAP as well so they map identically to the definition in the registry?

> 
> I would agree to Neil's comment on that one, that suggested that if we have the "datatypes" property, then we just need to have types like "count" or "size". Then for the "what do we count or calculate the size of?" question, the answer would be in the declared data types. 

> Regarding the size, I put it in bytes by default, but still precised that it's up to the server to choose (maybe some server wants octets?). But that might be confusing for the client... Or should we have more granular resource types here, like "bytes" and "octets", or "sizeBytes" and "sizeOctets"?


Bytes and Octets are the same thing, to a reasonable approximation:

https://en.wikipedia.org/wiki/Octet_(computing)

Byte has historically been used for other sizes, but it always means 8 bits these days.

I see no reason to allow any other unit - if we're doing 64 bit values there's plenty of room, and unit conversions at the low level suck and are grounds for confusion.

Bron.

--
 Bron Gondwana, CEO, Fastmail Pty Ltd
 brong@fastmailteam.com