Skip to content

Commit 25e87f2

Browse files
committed
[docs-only] Fix mermaid diagrams
1 parent ee2894b commit 25e87f2

File tree

1 file changed

+37
-25
lines changed

1 file changed

+37
-25
lines changed

docs/architecture/upload-processing.md

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ sequenceDiagram
2727
Client->>+ocdav: PUT /dav/spaces/{spaceid}/newfile.bin
2828
ocdav->>+storageprovider: InitiateFileUpload
2929
storageprovider-->>-ocdav: OK, Protocol simple, UploadEndpoint: /data, Token: {jwt}
30-
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/simple/91cc9882-db71-4b37-b694-a522850fcee1
31-
ocdav->>+dataprovider: PUT /data<br>X-Reva-Transfer: {jwt}
30+
Note right of ocdav: The {jwt} contains the internal actual target, eg.: http://localhost:9158/data/simple/91cc9882-db71-4b37-b694-a522850fcee1
31+
ocdav->>+dataprovider: PUT /data
32+
Note right of dataprovider: X-Reva-Transfer: {jwt}
3233
dataprovider-->>-ocdav: 201 Created
3334
ocdav-->>-Client: 201 Created
3435

@@ -48,19 +49,18 @@ sequenceDiagram
4849
participant datagateway
4950
participant dataprovider
5051

51-
52-
Client->>+ocdav: POST /dav/spaces/{spaceid}<br>Upload-Metadata: {base64 encoded filename etc}<br>TUS-Resumable: 1.0.0
52+
Client->>+ocdav: POST /dav/spaces/{spaceid}\nUpload-Metadata: {base64 encoded filename etc}\nTUS-Resumable: 1.0.0
5353
ocdav->>+storageprovider: InitiateFileUpload
5454
storageprovider-->>-ocdav: OK, Protocol tus, UploadEndpoint: /data, Token: {jwt}
55-
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
56-
ocdav-->>-Client: 201 Created<br>Location: /data/{jwt}<br>TUS-Resumable: 1.0.0
55+
Note right of ocdav: The {jwt} contains the internal actual target, eg.:\nhttp://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
56+
ocdav-->>-Client: 201 Created\nLocation: /data/{jwt}\nTUS-Resumable: 1.0.0
5757

58-
Client->>+datagateway: PATCH /data/{jwt}<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 0
58+
Client->>+datagateway: PATCH /data/{jwt}\nTUS-Resumable: 1.0.0\nUpload-Offset: 0
5959
Note over datagateway: unwrap the {jwt} target
60-
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160<br>X-Reva-Transfer: {jwt}
61-
Note over dataprovider: storage driver<br>handles request
62-
dataprovider-->>-datagateway: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
63-
datagateway-->>-Client: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
60+
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160\nX-Reva-Transfer: {jwt}
61+
Note over dataprovider: storage driver\nhandles request
62+
dataprovider-->>-datagateway: 204 No Content\nTUS-Resumable: 1.0.0\nUpload-Offset: 363976
63+
datagateway-->>-Client: 204 No Content\nTUS-Resumable: 1.0.0\nUpload-Offset: 363976
6464

6565
{{</mermaid>}}
6666

@@ -81,35 +81,47 @@ sequenceDiagram
8181
participant datagateway
8282
participant dataprovider
8383
participant nats
84+
participant processing
8485

85-
86-
Client->>+ocdav: POST /dav/spaces/{spaceid}<br>Upload-Metadata: {base64 encoded filename etc}<br>TUS-Resumable: 1.0.0
86+
Client->>+ocdav: POST /dav/spaces/{spaceid}
87+
Note left of Client: Upload-Metadata: {base64 encoded filename etc}\nTUS-Resumable: 1.0.0
8788
ocdav->>+storageprovider: InitiateFileUpload
8889
storageprovider-->>-ocdav: OK, Protocol tus, UploadEndpoint: /data, Token: {jwt}
89-
Note right of ocdav: The {jwt} contains the internal actual target, eg.:<br>http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
90-
ocdav-->>-Client: 201 Created<br>Location: /data/{jwt}<br>TUS-Resumable: 1.0.0
90+
Note right of ocdav: The {jwt} contains the internal actual target, eg.: http://localhost:9158/data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
91+
ocdav-->>-Client: 201 Created
92+
Note right of Client: Location: /data/{jwt}
93+
Note right of Client: TUS-Resumable: 1.0.0
9194

92-
Client->>+datagateway: PATCH /data/{jwt}<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 0
95+
Client->>+datagateway: PATCH /data/{jwt}
96+
Note right of datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 0
9397

9498
Note over datagateway: unwrap the {jwt} target
95-
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160<br>X-Reva-Transfer: {jwt}
96-
Note over dataprovider: storage driver<br>handles request
99+
datagateway->>+dataprovider: PATCH /data/tus/24d893f5-b942-4bc7-9fb0-28f49f980160
100+
Note over dataprovider: X-Reva-Transfer: {jwt}
101+
Note over dataprovider: storage driver
102+
Note over dataprovider: handles request
97103
dataprovider-)nats: emit all-bytes-received event
98104
nats-)processing: all-bytes-received({uploadid}) event
99-
Note over dataprovider: TODO: A lot of time may pass here, we could use<br> the `Prefer: respond-async` header to return early<br>with a 202 Accepted status and a Location header<br>to a websocket endpoint
105+
Note over dataprovider: TODO: A lot of time may pass here, we could use the `Prefer: respond-async` header to return early with a 202 Accepted status and a Location header to a websocket endpoint
100106
alt success
101-
processing-)nats: emit processing-finished({uploadid}) event
107+
processing-)nats: emit processing-finished({uploadid}) event
102108
nats-)dataprovider: processing-finished({uploadid}) event
103-
dataprovider-->>-datagateway: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
104-
datagateway-->>-Client: 204 No Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
109+
dataprovider-->>-datagateway: 204 No Content
110+
Note over datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
111+
datagateway-->>-Client: 204 No Content
112+
Note over Client: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
105113
else failure
106114
activate dataprovider
107115
activate datagateway
108116
processing-)nats: emit processing-aborted({uploadid}) event
109117
nats-)dataprovider: processing-aborted({uploadid}) event
110-
Note over dataprovider: FIXME: What HTTP status code should we report?<br>422 Unprocessable Content is just a proposal, see<br>https://httpwg.org/specs/rfc9110.html#status.422
111-
dataprovider-->>-datagateway: 422 Unprocessable Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
112-
datagateway-->>-Client: 422 Unprocessable Content<br>TUS-Resumable: 1.0.0<br>Upload-Offset: 363976
118+
Note over dataprovider: FIXME: What HTTP status code should we report?
119+
Note over dataprovider: 422 Unprocessable Content is just a proposal
120+
Note over dataprovider: see https://httpwg.org/specs/rfc9110.html#status.422
121+
dataprovider-->>-datagateway: 422 Unprocessable Content
122+
Note over datagateway: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
123+
datagateway-->>-Client: 422 Unprocessable Content
124+
Note over Client: TUS-Resumable: 1.0.0\nUpload-Offset: 363976
113125
end
114126

115127
{{</mermaid>}}

0 commit comments

Comments
 (0)