From f7ba0d3b4b2e7d0f5ecf39a4511ee5531b6900ae Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 25 Mar 2025 10:04:21 -0500 Subject: [PATCH] docs: deprecate setting ProtocolResponse.session to null (#46131) * docs: deprecate setting ProtocolResponse.session to null * docs: mark null ProtocolResponse.session as deprecated in struct docs * Update docs/breaking-changes.md Co-authored-by: Keeley Hammond --------- Co-authored-by: Keeley Hammond --- docs/api/structures/protocol-response.md | 2 ++ docs/breaking-changes.md | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/api/structures/protocol-response.md b/docs/api/structures/protocol-response.md index 6739ca77fbd5..244cb929653f 100644 --- a/docs/api/structures/protocol-response.md +++ b/docs/api/structures/protocol-response.md @@ -28,6 +28,8 @@ * `session` Session (optional) - The session used for requesting URL, by default the HTTP request will reuse the current session. Setting `session` to `null` would use a random independent session. This is only used for URL responses. + **Deprecated:** Using `null` to create a random independent session is + deprecated and will be removed soon. * `uploadData` [ProtocolResponseUploadData](protocol-response-upload-data.md) (optional) - The data used as upload data. This is only used for URL responses when `method` is `"POST"`. diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index bf21c28534b9..bd9cee115632 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -34,7 +34,7 @@ process.on('unhandledRejection', () => { }) ``` -### Removed:`isDefault` and `status` properties on `PrinterInfo` +### Removed: `isDefault` and `status` properties on `PrinterInfo` These properties have been removed from the PrinterInfo Object because they have been removed from upstream Chromium. @@ -46,6 +46,16 @@ When calling `Session.clearStorageData(options)`, the `options.quota` type [removed](https://chromium-review.googlesource.com/c/chromium/src/+/6309405) from upstream Chromium. +### Deprecated: `null` value for `session` property in `ProtocolResponse` + +Previously, setting the ProtocolResponse.session property to `null` +Would create a random independent session. This is no longer supported. + +Using single-purpose sessions here is discouraged due to overhead costs; +however, old code that needs to preserve this behavior can emulate it by +creating a random session with `session.fromPartition(some_random_string)` +and then using it in `ProtocolResponse.session`. + ### Deprecated: `quota` property in `Session.clearStorageData(options)` When calling `Session.clearStorageData(options)`, the `options.quota`