From ff98ad5d3593a4776476f7351e3131b11bb71fdb Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 14 Jul 2019 16:59:25 +0200 Subject: [PATCH 01/12] doc: deprecate http finished --- doc/api/deprecations.md | 20 ++++++++++++++++++++ doc/api/http.md | 8 ++++++++ doc/api/http2.md | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 46d2467c7234b8..ce2247a6de8f3a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2518,6 +2518,23 @@ Type: Documentation-only Prefer [`response.socket`][] over [`response.connection`] and [`request.socket`][] over [`request.connection`]. + +### DEP0XXX: http finished + + +Type: Documentation-only + +[`response.finished`][] indicates whether the [`response.end()`] has been +called, not whether the underlying data has been flushed and `'finish'` has been +emitted. Use [`response.writableFinished`][] or [`response.writableEnded`][] +accordingly instead to avoid the ambigiuty. + +[`--http-parser=legacy`]: cli.html#cli_http_parser_library [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size @@ -2576,6 +2593,9 @@ Prefer [`response.socket`][] over [`response.connection`] and [`request.connection`]: http.html#http_request_connection [`response.socket`]: http.html#http_response_socket [`response.connection`]: http.html#http_response_connection +[`response.finished`]: #http_response_finished +[`response.writableFinished`]: #http_response_writablefinished +[`response.writableEnded`]: #http_response_writableended [`script.createCachedData()`]: vm.html#vm_script_createcacheddata [`setInterval()`]: timers.html#timers_setinterval_callback_delay_args [`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args diff --git a/doc/api/http.md b/doc/api/http.md index 10f68cab4c3fc1..0d2aee5064ebd7 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -603,8 +603,11 @@ is finished. ### request.finished +> Stability: 0 - Deprecated. Use [`request.writableEnded`][]. + * {boolean} The `request.finished` property will be `true` if [`request.end()`][] @@ -1202,8 +1205,11 @@ is finished. ### response.finished +> Stability: 0 - Deprecated. Use [`response.writableEnded`][]. + * {boolean} The `response.finished` property will be `true` if [`response.end()`][] @@ -2258,12 +2264,14 @@ not abort the request or do anything besides add a `'timeout'` event. [`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed [`request.socket`]: #http_request_socket [`request.writableFinished`]: #http_request_writablefinished +[`request.writableEnded`]: #http_request_writableended [`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback [`response.end()`]: #http_response_end_data_encoding_callback [`response.getHeader()`]: #http_response_getheader_name [`response.setHeader()`]: #http_response_setheader_name_value [`response.socket`]: #http_response_socket [`response.writableFinished`]: #http_response_writablefinished +[`response.writableEnded`]: #http_response_writableended [`response.write()`]: #http_response_write_chunk_encoding_callback [`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback [`response.writeContinue()`]: #http_response_writecontinue diff --git a/doc/api/http2.md b/doc/api/http2.md index 494a7d8212f79e..78865e9be8d0b3 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3033,8 +3033,11 @@ is finished. #### response.finished +> Stability: 0 - Deprecated. Use [`response.writableEnded`][]. + * {boolean} Boolean value that indicates whether the response has completed. Starts @@ -3517,6 +3520,7 @@ following additional properties: [`response.end()`]: #http2_response_end_data_encoding_callback [`response.setHeader()`]: #http2_response_setheader_name_value [`response.socket`]: #http2_response_socket +[`response.writableEnded`]: #http2_response_writableended [`response.write()`]: #http2_response_write_chunk_encoding_callback [`response.write(data, encoding)`]: http.html#http_response_write_chunk_encoding_callback [`response.writeContinue()`]: #http2_response_writecontinue From e1408d39ce74c27d1b0486fda07c83d574cfdbd0 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 19 Sep 2019 09:30:31 +0200 Subject: [PATCH 02/12] fixup --- doc/api/deprecations.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ce2247a6de8f3a..150dd1b28b4a62 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2530,8 +2530,11 @@ changes: Type: Documentation-only [`response.finished`][] indicates whether the [`response.end()`] has been -called, not whether the underlying data has been flushed and `'finish'` has been -emitted. Use [`response.writableFinished`][] or [`response.writableEnded`][] +called and [`response.writableEnded`][] is `true`, not whether the underlying +data has been flushed, `'finish'` has been emitted and +[`response.writableFinished`][] is `true`. + +Use [`response.writableFinished`][] or [`response.writableEnded`][] accordingly instead to avoid the ambigiuty. [`--http-parser=legacy`]: cli.html#cli_http_parser_library From fffc59643d2e14ac29ad50fa82d141fa1c1d2808 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 19 Sep 2019 14:06:01 +0200 Subject: [PATCH 03/12] fixup --- doc/api/deprecations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 150dd1b28b4a62..adc62a5732cadf 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2529,7 +2529,7 @@ changes: Type: Documentation-only -[`response.finished`][] indicates whether the [`response.end()`] has been +[`response.finished`][] indicates whether [`response.end()`] has been called and [`response.writableEnded`][] is `true`, not whether the underlying data has been flushed, `'finish'` has been emitted and [`response.writableFinished`][] is `true`. @@ -2537,6 +2537,8 @@ data has been flushed, `'finish'` has been emitted and Use [`response.writableFinished`][] or [`response.writableEnded`][] accordingly instead to avoid the ambigiuty. +To maintain existing functionality use [`response.writableFinished`][]. + [`--http-parser=legacy`]: cli.html#cli_http_parser_library [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation From 53add505d14e411deb920b01cfef379e80ed652b Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 19 Sep 2019 17:56:04 +0200 Subject: [PATCH 04/12] fixup --- doc/api/deprecations.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index adc62a5732cadf..c530b65fbf4439 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2537,9 +2537,8 @@ data has been flushed, `'finish'` has been emitted and Use [`response.writableFinished`][] or [`response.writableEnded`][] accordingly instead to avoid the ambigiuty. -To maintain existing functionality use [`response.writableFinished`][]. +To maintain existing functionality use [`response.writableEnded`][]. -[`--http-parser=legacy`]: cli.html#cli_http_parser_library [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size From 4d8bfdf86bec4c35c9eb9bca5fdd81ddf4d4a198 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Tue, 19 Nov 2019 16:49:18 +0100 Subject: [PATCH 05/12] Update doc/api/deprecations.md Co-Authored-By: Ruben Bridgewater --- doc/api/deprecations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index c530b65fbf4439..1d552b66d4c129 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2519,7 +2519,7 @@ Prefer [`response.socket`][] over [`response.connection`] and [`request.socket`][] over [`request.connection`]. -### DEP0XXX: http finished +### DEP0XXX: http/2 request.finished and response.finished