You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Benoit Tellier (Jira)" <se...@james.apache.org> on 2020/08/14 04:17:00 UTC

[jira] [Created] (JAMES-3356) Mailbox/set: reusing creationId

Benoit Tellier created JAMES-3356:
-------------------------------------

             Summary: Mailbox/set: reusing creationId
                 Key: JAMES-3356
                 URL: https://issues.apache.org/jira/browse/JAMES-3356
             Project: James Server
          Issue Type: Improvement
          Components: JMAP
            Reporter: Benoit Tellier
            Assignee: Antoine Duprat


https://jmap.io/spec-core.html#set

```
Some records may hold references to other records (foreign keys). That reference may be set (via create or update) in the same request as the referenced record is created. To do this, the client refers to the new record using its creation id prefixed with a #. The order of the method calls in the request by the client MUST be such that the record being referenced is created in the same or an earlier call. Thus, the server never has to look ahead. Instead, while processing a request, the server MUST keep a simple map for the duration of the request of creation id to record id for each newly created record, so it can substitute in the correct value if necessary in later method calls. In the case of records with references to the same type, the server MUST order the creates and updates within a single method call so that creates happen before their creation ids are referenced by another create/update/destroy in the same call.
```

Definition of done: write a memory integration test creating then updating a given record, in the same method call.

EG :

```
{
        |   "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
        |   "methodCalls": [
        |       [
        |           "Mailbox/set",
        |           {
        |                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
        |                "create": {
        |                    "C42": {
        |                      "name": "mailbox",
        |                    }
        |                },
        |                "destroy": ["#C42"]
        |           },
        |    "c1"
        |       ]
        |   ]
        |}
```

Note that this is different from backreference



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org