Re: [Jmap] Hacker News Discussion - getMailboxes single data set vs tree primitives or paging

Bron Gondwana <brong@fastmail.fm> Mon, 08 May 2017 13:14 UTC

Return-Path: <brong@fastmail.fm>
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 B208512946C for <jmap@ietfa.amsl.com>; Mon, 8 May 2017 06:14:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.82
X-Spam-Level:
X-Spam-Status: No, score=-0.82 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmail.fm header.b=MA0nQvoW; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=gDm4A3Wx
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 i8oINfYNqweN for <jmap@ietfa.amsl.com>; Mon, 8 May 2017 06:14:30 -0700 (PDT)
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6528A129467 for <jmap@ietf.org>; Mon, 8 May 2017 06:14:30 -0700 (PDT)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CA8BA208D8 for <jmap@ietf.org>; Mon, 8 May 2017 09:14:29 -0400 (EDT)
Received: from web4 ([10.202.2.214]) by compute6.internal (MEProxy); Mon, 08 May 2017 09:14:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=4Xa+1ufnlYGjjQ6yjPv/w+tgaorB3 puppCpIRDSM134=; b=MA0nQvoW1l3Y57NCRFBh1yY/LSreTn4liwIYz1tdng8F+ o/SIfMEL/C15AxFEXlb7x16ITLYVTgnpPYvIwNmfFhb0+y6R1eOX79r04jjtepX0 b/drpGAIo+h3EWG49DpikPDjOiB1tg6KVNZiElkWhk/kQAqUQNLP9JjPOT7DzAKV X6E+qMH3pyEw/RWvS9FqHcMfUHKNfYXeSIcNwVT8beAyXdjBdvm2YQ5LT/Xh830Y VH7eUzV4lfVhpfuOy2IdvN2OmJMm2wuEUArA9aBBtKP3c7UEyY0qHQQqX6dN5IGQ /67NuDFfmfHrg4L0SL9wjfqakudWOEmpMDyETgd+Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4Xa+1u fnlYGjjQ6yjPv/w+tgaorB3puppCpIRDSM134=; b=gDm4A3WxkM12JVvS0iucoJ WpplgRxO3Nh8gpr3qUXYYTNZS7t9kGE37352b5EPQxXW1MYT75tGF6banmdw+osW gJ+6kR5VVII8sXxbFcEV0okYP9RwCQGqrzLsaZFvitqKpCAkZK75h40T7289OId3 qw5JMhe6anutNTLDcOK3i5jwcSBKqmxDhK4pZaTw4yqMQFNI42f7mNQpUHWx6l74 d8lC0VWZJBsHeI0kI214fXPn3gOKUYkxfZN/GH1clUsCXuBoa8Yc8p9QBnmsdLG5 IRnNYl/GUS42bqCDiCgvO4UYeve/68sUP7BM7/p+6NwRf5vweY4ohd0keIva2Trg ==
X-ME-Sender: <xms:NW8QWcxL8JzHkN8otNuDtSmekTmeO5bms74NPS-CCgFy-qAqOWWAJg>
Received: by mailuser.nyi.internal (Postfix, from userid 99) id 89C36BAB6F; Mon, 8 May 2017 09:14:29 -0400 (EDT)
Message-Id: <1494249269.88461.969397104.25D88F0A@webmail.messagingengine.com>
From: Bron Gondwana <brong@fastmail.fm>
To: jmap@ietf.org
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: multipart/alternative; boundary="_----------=_1494249269884610"
X-Mailer: MessagingEngine.com Webmail Interface - ajax-6cc55fe1
In-Reply-To: <1494224344.1447245.969038872.78D5E02D@webmail.messagingengine.com>
References: <20170507123912.GA22520@snake.grepular.com> <FF749B75-173D-4086-BAE6-AFB897D5F676@fugue.com> <1494224344.1447245.969038872.78D5E02D@webmail.messagingengine.com>
Date: Mon, 08 May 2017 23:14:29 +1000
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/MPlL8uuZbu8Mnx-1kFAFU3xM-AY>
Subject: Re: [Jmap] Hacker News Discussion - getMailboxes single data set vs tree primitives or paging
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 08 May 2017 13:14:31 -0000

On Mon, 8 May 2017, at 16:19, Neil Jenkins wrote:
> Having said that, there's a standard mechanism in JMAP for doing
> querying/sorting/paging of a record type (getFooList[1]), so if we do
> decide we want this capability it is mostly obvious how it should be
> specified. We'd include a filter option for *parentId* so you could
> easily fetch as a hierarchy if you want, and it would be easy to add
> an isArchived flag or similar later and filter on that if desired.> 
> As long as we still allow *getMailboxes* to be called with a null
> *ids* argument (therefore returning all mailboxes), clients can still
> just ignore all this if they always need to fetch the whole set up
> front. It's mainly therefore an extra burden on server
> implementations. So is it worth the tradeoff? Thoughts?
It makes sense to me to have a way to do paging/limiting.  It should be
easy enough for a server implementation.  We wouldn't even need
getMailboxes with a null ids, just a getMailboxList with a search/sort
that matches everything and a fetchRecords.
The tricky bit is that Mailboxes is a tree rather than a list, so the
I'm not sure how you would sort!  Simplest of course is to not do any
sorting, or to sort the entire list lexically by full path with the part
separator being a null so it always sorts by full name:
A
A/foo
A/foo/bar
A/foo bar

(that's super easy for me to do on the server, and to page into.  Can
also page just within a single parent level - which gets you both "*"
and "%" list equivalents from IMAP)
Bron.

--
  Bron Gondwana
  brong@fastmail.fm



Links:

  1. http://jmap.io/spec-core.html#querying-data