From 7deef74348a7ba11ab84f483faaf4dde1755568b Mon Sep 17 00:00:00 2001 From: Jacob Marble Date: Tue, 13 Aug 2024 13:38:23 -0700 Subject: [PATCH] fix: handle 201 response from write endpoint InfluxDB v3 returns 201 for partial write errors. --- packages/core/src/impl/WriteApiImpl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/impl/WriteApiImpl.ts b/packages/core/src/impl/WriteApiImpl.ts index 3dc4b33f..4eca13c7 100644 --- a/packages/core/src/impl/WriteApiImpl.ts +++ b/packages/core/src/impl/WriteApiImpl.ts @@ -236,8 +236,9 @@ export default class WriteApiImpl implements WriteApi { reject(error) }, complete(): void { + // InfluxDB v3 returns 201 for partial success // older implementations of transport do not report status code - if (responseStatusCode == 204 || responseStatusCode == undefined) { + if (responseStatusCode == 204 || responseStatusCode == 201 || responseStatusCode == undefined) { self.writeOptions.writeSuccess.call(self, lines) self.retryStrategy.success() resolve()