@sentio/cli 4.0.0-rc.1 → 4.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -165295,7 +165295,8 @@ async function uploadFile(config, auth, options) {
165295
165295
  try {
165296
165296
  await upload2();
165297
165297
  } catch (e3) {
165298
- if (e3?.constructor.name === "FetchError" && e3.type === "system" && e3.code === "EPIPE") {
165298
+ const RETRYABLE_CODES = ["EPIPE", "ECONNRESET", "ETIMEDOUT", "ECONNREFUSED", "EAI_AGAIN"];
165299
+ if (e3?.constructor.name === "FetchError" && e3.type === "system" && RETRYABLE_CODES.includes(e3.code)) {
165299
165300
  error = e3;
165300
165301
  await new Promise((resolve) => setTimeout(resolve, 1e3));
165301
165302
  await tryUploading();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/cli",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@ import { CommonExecOptions, execFileSync } from 'child_process'
11
11
  import { getApiUrl, getSdkVersion } from '../utils.js'
12
12
  import readline from 'readline'
13
13
  import JSZip from 'jszip'
14
- import { UserInfo } from '../../../protos/lib/service/common/protos/common.js'
14
+ import type { UserInfo } from '../../../protos/lib/service/common/protos/common_pb.js'
15
15
  import { CommandOptionsType } from './types.js'
16
16
  import {
17
17
  getSentioNetworkConfig,
@@ -738,7 +738,12 @@ export async function uploadFile(
738
738
  try {
739
739
  await upload()
740
740
  } catch (e: any) {
741
- if (e?.constructor.name === 'FetchError' && e.type === 'system' && e.code === 'EPIPE') {
741
+ // Transient network errors while PUT-ing the packed processor to the signed
742
+ // storage URL: node-fetch surfaces these as `FetchError` with `type: 'system'`
743
+ // and the underlying socket errno in `code`. Retry all of them, not just EPIPE
744
+ // (ECONNRESET / "socket hang up" is the most common one against GCS).
745
+ const RETRYABLE_CODES = ['EPIPE', 'ECONNRESET', 'ETIMEDOUT', 'ECONNREFUSED', 'EAI_AGAIN']
746
+ if (e?.constructor.name === 'FetchError' && e.type === 'system' && RETRYABLE_CODES.includes(e.code)) {
742
747
  error = e
743
748
  await new Promise((resolve) => setTimeout(resolve, 1000))
744
749
  await tryUploading()