importMessages, fetchMessages

19 views
Skip to first unread message

Ricardo Signes

unread,
Jul 6, 2016, 2:08:49 PM7/6/16
to jmap-d...@googlegroups.com
I'm writing some code that acts on messages in a JMAP store. The message might
have been retrieved by id, or it may have just been imported.

Messages have a fair number of properties that are computed by the server, and
I'll need to know a few of them. Right now, if I'm importing a message, I need
two HTTP transactions to get (say) the replyTo of a message: one for to
importMessages, one for getMessages (to say nothing of the message upload). I
don't want to compute it myself, since I might get a different result than the
server on some inputs.

I'd like importMessages to take a boolean fetchMessages argument to trigger an
automatic getMessages on the created ids. Alternately, a means to request that
the objects in the `created` entry in the messagesImported response are not
so sparse, but contain full objects

--
Ricardo Signes (rjbs)
Research & Development, IC Group

Bron Gondwana

unread,
Jul 6, 2016, 7:21:53 PM7/6/16
to jmap-d...@googlegroups.com
Isn't this just a general case of using creation id in another command?

[
[ "importMessages", {
"messages" : {
"m1" : {
"blobId" : ...
},
},
}, "#1"],
[ "fetchMessages", {
"ids" : [ "#m1" ],
"properties" : ...
}, "#1"]
]

If anything I would suggest that "importMessages" should return less and the caller should
do a fetchMessages with what they actually need.

Bron.
> --
> You received this message because you are subscribed to the Google Groups "JMAP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jmap-discuss...@googlegroups.com.
> To post to this group, send email to jmap-d...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jmap-discuss/20160706180848.GA64145%40lab.int.icgroup.com.
> For more options, visit https://groups.google.com/d/optout.


--
Bron Gondwana
br...@fastmail.fm

Ricardo Signes

unread,
Jul 6, 2016, 8:32:55 PM7/6/16
to jmap-d...@googlegroups.com
* Bron Gondwana <br...@fastmail.fm> [2016-07-06T19:21:52]
> Isn't this just a general case of using creation id in another command?

Oho, I hadn't considered that. The specs on importMessages *do* call the
property names in the "messags" object "creation ids," but I hadn't considered
that this was just as addressable as a setFoos creation id.

Thanks, I'll use that.
Reply all
Reply to author
Forward
0 new messages