You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 667098e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .changeset/storage-upload-bound-built-in-default.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,16 +17,21 @@ Metadata-protocol: none
17
17
-**Host option.**`maxUploadMb` on the `StorageServicePlugin` constructor, on `mountStorageRoutes` and on `registerStorageRoutes` is the host layer, exactly like `presignedTtl` and `sessionTtl`. It takes a positive number of MB, or `'unlimited'` for no bound. Any other value (`0`, a negative or non-finite number, a numeric string, any other string) refuses construction or the mount.
18
18
-**Failure paths.** A settings read that fails, and a saved value that is present but not a positive number, take the host option or else the built-in default, never no bound.
19
19
-**Coverage.** The bound applies wherever an upload is judged: the byte doors (the chunk `PUT`, the presigned local raw `PUT`, the upload-link `PUT` and its several-file form), the declared-size doors (presign, chunked start), and the server-side file verbs (`field-files`, `file-attachments` and the upload link's several-file spend).
20
-
-**Boot line.**One line at boot names the bound in force and the layer it came from. With an explicit `'unlimited'`it is a `warn`.
20
+
-**Boot line.**Each host door says, once at boot or mount, the bound in force and the layer it came from: the plugin through its logger, `mountStorageRoutes` and `registerStorageRoutes` through the `logger` they are given. With an explicit `'unlimited'`the line is a `warn`, and it is said even when no logger was passed, on `console.warn`.
21
21
22
22
**Who moves.** Each of these moves from no upload bound to 100 MB:
23
23
24
24
- a DevPlugin-composed server;
25
25
-`--preset minimal` with storage;
26
26
- a `mountStorageRoutes` host over a bare adapter or over a plugin bound to no settings;
27
27
- an embedder that passes `bindToSettings: false`;
28
-
- a settings-bound host while its settings read fails.
28
+
- a settings-bound host while its settings read fails;
29
+
- a host whose saved or env-sourced `max_upload_mb` is present but not a positive number (it was dropped, and nothing stood in its place).
29
30
30
-
The remedy for each is one host option: `new StorageServicePlugin({ maxUploadMb: 500 })` for another bound, or `maxUploadMb: 'unlimited'` to keep accepting uploads of any size (boot then says so at `warn`). Pass the same option to `mountStorageRoutes` for that mount's doors.
31
+
Remedies:
32
+
33
+
-**A host that constructs the plugin** (`bindToSettings: false` embedders, `--preset minimal`, settings-fault hosts): one option, `new StorageServicePlugin({ maxUploadMb: 500 })` for another bound, or `maxUploadMb: 'unlimited'` to keep accepting uploads of any size (boot then says so at `warn`). A `mountStorageRoutes` or `registerStorageRoutes` host passes the same option for that mount's doors.
34
+
-**A DevPlugin-composed server**: DevPlugin constructs the storage plugin with no options, so turn its storage toggle off and mount the plugin yourself: `new DevPlugin({ services: { storage: false }, extraPlugins: [new StorageServicePlugin({ maxUploadMb: 500 })] })`, or list the `StorageServicePlugin` instance in the stack's own `plugins`, where an explicit instance wins.
35
+
-**A host with an invalid saved value**: correct the saved `max_upload_mb` (Setup's File Storage settings, or the env override) to a positive number. The saved layer cannot spell "no bound"; to accept any size, remove the saved value and pass the host option `maxUploadMb: 'unlimited'`.
31
36
32
37
**Unchanged.** A settings-bound host with nothing saved, which is the default `os serve`, already enforced the manifest's 100 MB and still does. A saved `max_upload_mb` still wins over every host option. The 18.5.0 note "with `max_upload_mb` unset a byte door states no bound and reads the whole body" no longer holds: with `max_upload_mb` unset a byte door states the host's bound or else the built-in 100 MB, and it states no bound only under an explicit host `'unlimited'`.
Copy file name to clipboardExpand all lines: packages/services/service-storage/README.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,9 +132,20 @@ new StorageServicePlugin({ maxUploadMb: 500 }); // the host's bound, in
132
132
newStorageServicePlugin({ maxUploadMb: 'unlimited' }); // no bound, announced at warn on boot
133
133
```
134
134
135
-
Anything else (`0`, a negative or non-finite number, a numeric string, any
136
-
other string) refuses construction. One line at boot names the bound in force
137
-
and the layer it came from. On the S3 adapter a presigned upload is judged by
135
+
Anything else (`0`, a negative or non-finite number, a number too small to
136
+
bound one byte, a numeric string, any other string) refuses construction. Each
137
+
host door — the plugin, `mountStorageRoutes`, `registerStorageRoutes` — says once
138
+
the bound in force and the layer it came from; an explicit `'unlimited'` is said
139
+
at `warn`, on `console.warn` when the door was given no logger.
140
+
141
+
Who moved from no bound to 100 MB, and the remedy:
142
+
143
+
| Host | Remedy |
144
+
|:---|:---|
145
+
| Constructs the plugin with no settings bound (`bindToSettings: false`, `--preset minimal`), or its settings read fails |`maxUploadMb: 500` or `'unlimited'` on the plugin |
146
+
|`mountStorageRoutes` / `registerStorageRoutes` over a bare adapter or an unbound plugin | the same option on that call |
147
+
| DevPlugin-composed server (DevPlugin builds the plugin with no options) |`new DevPlugin({ services: { storage: false }, extraPlugins: [new StorageServicePlugin({ maxUploadMb: 500 })] })`, or list the instance in the stack's `plugins`|
148
+
| A saved or env-sourced `max_upload_mb` that is not a positive number | correct the saved value; the saved layer cannot spell "no bound", so to accept any size remove it and pass `maxUploadMb: 'unlimited'` | On the S3 adapter a presigned upload is judged by
138
149
its declared size — the bytes go straight to the bucket.
0 commit comments