@dynamic-labs-wallet/browser 1.0.73 → 1.0.75
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/index.cjs +26 -11
- package/index.esm.js +26 -11
- package/package.json +4 -4
- package/src/services/logger.d.ts.map +1 -1
- package/src/utils.d.ts.map +1 -1
package/index.cjs
CHANGED
|
@@ -1099,8 +1099,12 @@ const logRetryFailure = (operationName, attempts, maxAttempts, errorContext, log
|
|
|
1099
1099
|
willRetry: !isNonRetryable && attempts < maxAttempts
|
|
1100
1100
|
}));
|
|
1101
1101
|
};
|
|
1102
|
+
// Logged at `warn`, not `error`: retry exhaustion always re-throws, and the
|
|
1103
|
+
// calling operation's own catch logs the terminal failure at error level (e.g.
|
|
1104
|
+
// "Error in keyGen"). Logging this at error too double-counted every exhausted
|
|
1105
|
+
// ceremony in error dashboards / the catch-all monitor.
|
|
1102
1106
|
const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)=>{
|
|
1103
|
-
core.Logger.
|
|
1107
|
+
core.Logger.warn(`Failed to execute ${operationName} after ${maxAttempts} attempts - stopping retry`, _extends({}, logContext, errorContext, {
|
|
1104
1108
|
totalAttempts: maxAttempts
|
|
1105
1109
|
}));
|
|
1106
1110
|
};
|
|
@@ -1178,19 +1182,23 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1178
1182
|
return NON_RETRYABLE_CEREMONY_ERROR_MESSAGES.some((msg)=>message.includes(msg));
|
|
1179
1183
|
};
|
|
1180
1184
|
/**
|
|
1181
|
-
* Client-error (4xx) responses won't succeed on retry:
|
|
1182
|
-
*
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1185
|
+
* Client-error (4xx) responses won't succeed on retry: 400 (invalid request)
|
|
1186
|
+
* and 422 (unprocessable content) mean the request itself is malformed, 401
|
|
1187
|
+
* (missing auth) and 403 (forbidden) can't gain credentials by retrying, 409
|
|
1188
|
+
* (already exists, e.g. an already-imported key) is terminal, and retrying a 429
|
|
1189
|
+
* burst just amplifies the rate limiter. These dominate keyGen retry exhaustions
|
|
1190
|
+
* in production. Status is read from `WalletApiError.status`, a raw `AxiosError`
|
|
1191
|
+
* (`getHttpStatus`), a `.status` assigned onto a plain Error (SSE error-event
|
|
1192
|
+
* shape), or parsed from the SSE handler's `Request failed with status <code>`
|
|
1193
|
+
* message. Note 409 reaches us via that SSE message — `handleAxiosError` remaps
|
|
1194
|
+
* unlisted statuses (incl. 409) to 500, so it never arrives as `WalletApiError(409)`.
|
|
1195
|
+
* 5xx / network stay retryable.
|
|
1190
1196
|
*/ const NON_RETRYABLE_CEREMONY_STATUSES = new Set([
|
|
1197
|
+
400,
|
|
1191
1198
|
401,
|
|
1192
1199
|
403,
|
|
1193
1200
|
409,
|
|
1201
|
+
422,
|
|
1194
1202
|
429
|
|
1195
1203
|
]);
|
|
1196
1204
|
const SSE_STATUS_MESSAGE = /Request failed with status (\d{3})/;
|
|
@@ -1927,6 +1935,13 @@ const buildHttpCeremonyMeta = (fields)=>_extends({
|
|
|
1927
1935
|
* `WalletApiError` and caught again (e.g. by queue error handlers).
|
|
1928
1936
|
* Logging these at `warn` prevents double-counting them as real errors.
|
|
1929
1937
|
*/ const isTransientApiError = (error)=>error instanceof core.WalletApiError && error.status === 429;
|
|
1938
|
+
/**
|
|
1939
|
+
* Returns true for missing/expired end-user auth (401). This is a normal
|
|
1940
|
+
* session-lifecycle event (cookie/JWT expired, user must re-authenticate),
|
|
1941
|
+
* not an actionable server error — retrying cannot add credentials. Logged
|
|
1942
|
+
* at `warn` so it stays queryable without firing error-level monitors. It was
|
|
1943
|
+
* the dominant `Error in getWallet` catch-all contributor.
|
|
1944
|
+
*/ const isExpiredAuthError = (error)=>error instanceof core.WalletApiError && error.status === 401;
|
|
1930
1945
|
/**
|
|
1931
1946
|
* Returns true for p-queue TimeoutError. These are transient and
|
|
1932
1947
|
* retryable client-side, so logging at `warn` prevents them from
|
|
@@ -1950,7 +1965,7 @@ const resolveLogLevel = (error, fallback)=>{
|
|
|
1950
1965
|
if (isExpectedUserError(error)) {
|
|
1951
1966
|
return 'info';
|
|
1952
1967
|
}
|
|
1953
|
-
if (isTransientApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error)) {
|
|
1968
|
+
if (isTransientApiError(error) || isExpiredAuthError(error) || isQueueTimeoutError(error) || isClientNetworkError(error)) {
|
|
1954
1969
|
return 'warn';
|
|
1955
1970
|
}
|
|
1956
1971
|
return fallback;
|
package/index.esm.js
CHANGED
|
@@ -1100,8 +1100,12 @@ const logRetryFailure = (operationName, attempts, maxAttempts, errorContext, log
|
|
|
1100
1100
|
willRetry: !isNonRetryable && attempts < maxAttempts
|
|
1101
1101
|
}));
|
|
1102
1102
|
};
|
|
1103
|
+
// Logged at `warn`, not `error`: retry exhaustion always re-throws, and the
|
|
1104
|
+
// calling operation's own catch logs the terminal failure at error level (e.g.
|
|
1105
|
+
// "Error in keyGen"). Logging this at error too double-counted every exhausted
|
|
1106
|
+
// ceremony in error dashboards / the catch-all monitor.
|
|
1103
1107
|
const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)=>{
|
|
1104
|
-
Logger.
|
|
1108
|
+
Logger.warn(`Failed to execute ${operationName} after ${maxAttempts} attempts - stopping retry`, _extends({}, logContext, errorContext, {
|
|
1105
1109
|
totalAttempts: maxAttempts
|
|
1106
1110
|
}));
|
|
1107
1111
|
};
|
|
@@ -1179,19 +1183,23 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1179
1183
|
return NON_RETRYABLE_CEREMONY_ERROR_MESSAGES.some((msg)=>message.includes(msg));
|
|
1180
1184
|
};
|
|
1181
1185
|
/**
|
|
1182
|
-
* Client-error (4xx) responses won't succeed on retry:
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1186
|
+
* Client-error (4xx) responses won't succeed on retry: 400 (invalid request)
|
|
1187
|
+
* and 422 (unprocessable content) mean the request itself is malformed, 401
|
|
1188
|
+
* (missing auth) and 403 (forbidden) can't gain credentials by retrying, 409
|
|
1189
|
+
* (already exists, e.g. an already-imported key) is terminal, and retrying a 429
|
|
1190
|
+
* burst just amplifies the rate limiter. These dominate keyGen retry exhaustions
|
|
1191
|
+
* in production. Status is read from `WalletApiError.status`, a raw `AxiosError`
|
|
1192
|
+
* (`getHttpStatus`), a `.status` assigned onto a plain Error (SSE error-event
|
|
1193
|
+
* shape), or parsed from the SSE handler's `Request failed with status <code>`
|
|
1194
|
+
* message. Note 409 reaches us via that SSE message — `handleAxiosError` remaps
|
|
1195
|
+
* unlisted statuses (incl. 409) to 500, so it never arrives as `WalletApiError(409)`.
|
|
1196
|
+
* 5xx / network stay retryable.
|
|
1191
1197
|
*/ const NON_RETRYABLE_CEREMONY_STATUSES = new Set([
|
|
1198
|
+
400,
|
|
1192
1199
|
401,
|
|
1193
1200
|
403,
|
|
1194
1201
|
409,
|
|
1202
|
+
422,
|
|
1195
1203
|
429
|
|
1196
1204
|
]);
|
|
1197
1205
|
const SSE_STATUS_MESSAGE = /Request failed with status (\d{3})/;
|
|
@@ -1928,6 +1936,13 @@ const buildHttpCeremonyMeta = (fields)=>_extends({
|
|
|
1928
1936
|
* `WalletApiError` and caught again (e.g. by queue error handlers).
|
|
1929
1937
|
* Logging these at `warn` prevents double-counting them as real errors.
|
|
1930
1938
|
*/ const isTransientApiError = (error)=>error instanceof WalletApiError && error.status === 429;
|
|
1939
|
+
/**
|
|
1940
|
+
* Returns true for missing/expired end-user auth (401). This is a normal
|
|
1941
|
+
* session-lifecycle event (cookie/JWT expired, user must re-authenticate),
|
|
1942
|
+
* not an actionable server error — retrying cannot add credentials. Logged
|
|
1943
|
+
* at `warn` so it stays queryable without firing error-level monitors. It was
|
|
1944
|
+
* the dominant `Error in getWallet` catch-all contributor.
|
|
1945
|
+
*/ const isExpiredAuthError = (error)=>error instanceof WalletApiError && error.status === 401;
|
|
1931
1946
|
/**
|
|
1932
1947
|
* Returns true for p-queue TimeoutError. These are transient and
|
|
1933
1948
|
* retryable client-side, so logging at `warn` prevents them from
|
|
@@ -1951,7 +1966,7 @@ const resolveLogLevel = (error, fallback)=>{
|
|
|
1951
1966
|
if (isExpectedUserError(error)) {
|
|
1952
1967
|
return 'info';
|
|
1953
1968
|
}
|
|
1954
|
-
if (isTransientApiError(error) || isQueueTimeoutError(error) || isClientNetworkError(error)) {
|
|
1969
|
+
if (isTransientApiError(error) || isExpiredAuthError(error) || isQueueTimeoutError(error) || isClientNetworkError(error)) {
|
|
1955
1970
|
return 'warn';
|
|
1956
1971
|
}
|
|
1957
1972
|
return fallback;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.0.75",
|
|
8
8
|
"@dynamic-labs-wallet/forward-mpc-client": "1.0.1",
|
|
9
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
10
|
-
"@dynamic-labs/sdk-api-core": "^0.0.
|
|
9
|
+
"@dynamic-labs-wallet/primitives": "1.0.75",
|
|
10
|
+
"@dynamic-labs/sdk-api-core": "^0.0.1082",
|
|
11
11
|
"argon2id": "1.0.1",
|
|
12
12
|
"axios": "1.16.0",
|
|
13
13
|
"p-queue": "9.1.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AAqCA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,OAIrD,CAAC;AAmBF,eAAO,MAAM,QAAQ,wCAKlB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B,KAAG,IAkBH,CAAC"}
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,cAAc,EAId,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAkBhD,eAAO,MAAM,SAAS,eAAwC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,aAAa,WAAY,GAAG,KAAG,UAAU,GAAG,cAsBxD,CAAC;AAEF,eAAO,MAAM,+BAA+B,iEAIzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,WAGA,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa;IACnD,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBAoCH,CAAC;AA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