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: [email protected]
For additional commands, e-mail: [email protected]