@friggframework/core 2.0.0--canary.623.ee3bde8.0 → 2.0.0--canary.623.1559ce4.0

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.
@@ -11,10 +11,8 @@ class Requester extends Delegate {
11
11
  this.backOff = get(params, 'backOff', [1, 3, 10, 30, 60, 180]);
12
12
  this.isRefreshable = false;
13
13
  this.refreshCount = 0;
14
- // Independent from the `i` backoff-attempt counter passed through
15
- // _request's recursion — a 429/5xx retry earlier in the same call
16
- // already advances `i`, and gating the 401 grace retry on `i === 0`
17
- // would skip it whenever a 401 follows any prior backoff response.
14
+ // Deliberately separate from `i` — a 429/5xx retry must not consume
15
+ // the 401 grace retry budget below.
18
16
  this.authGraceRetryCount = 0;
19
17
  this.DLGT_INVALID_AUTH = 'INVALID_AUTH';
20
18
  this.delegateTypes.push(this.DLGT_INVALID_AUTH);
@@ -157,16 +155,8 @@ class Requester extends Delegate {
157
155
 
158
156
  if (status === 401) {
159
157
  if (!this.isRefreshable) {
160
- // A non-refreshable requester (ApiKeyRequester,
161
- // BasicAuthRequester) has no token to renew, but a single
162
- // 401 is not necessarily proof the credential itself is
163
- // bad — it may be a transient edge/gateway hiccup. Grant
164
- // one grace retry of the same request before concluding
165
- // the credential is truly invalid, mirroring the single
166
- // refresh attempt OAuth2Requester gets below. Gated on
167
- // authGraceRetryCount rather than `i` so an earlier
168
- // 429/5xx backoff on the same call doesn't consume the
169
- // grace retry before a 401 is even seen.
158
+ // One grace retry before invalidating — a single 401
159
+ // isn't proof the credential is bad.
170
160
  if (this.authGraceRetryCount === 0) {
171
161
  this.authGraceRetryCount++;
172
162
  clearRequestTimer();
@@ -215,10 +205,9 @@ class Requester extends Delegate {
215
205
  );
216
206
  }
217
207
 
218
- // Successful response: reset the per-instance refresh/grace
219
- // budgets so a later 401 in the same Requester lifetime can
220
- // attempt refresh (or another grace retry) again instead of
221
- // silently falling through.
208
+ // Successful response: reset the per-instance refresh budget so
209
+ // a later 401 in the same Requester lifetime can attempt refresh
210
+ // again instead of silently falling through.
222
211
  this.refreshCount = 0;
223
212
  this.authGraceRetryCount = 0;
224
213
 
@@ -237,12 +226,6 @@ class Requester extends Delegate {
237
226
  }
238
227
  }
239
228
 
240
- // Builds a diagnostic FetchError from the failed 401 response, notifies
241
- // delegates with it attached (so the credential-invalidation chain can
242
- // log real detail instead of a bare "invalid credentials" with no
243
- // evidence), and returns the error for the caller to throw. Notifying
244
- // and throwing are split so notify() always fires even though `await`ing
245
- // it happens before the throw.
246
229
  async _invalidateAuth(encodedUrl, options, response) {
247
230
  const fetchError = await FetchError.create({
248
231
  resource: encodedUrl,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.623.ee3bde8.0",
4
+ "version": "2.0.0--canary.623.1559ce4.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@friggframework/eslint-config": "2.0.0--canary.623.ee3bde8.0",
42
- "@friggframework/prettier-config": "2.0.0--canary.623.ee3bde8.0",
43
- "@friggframework/test": "2.0.0--canary.623.ee3bde8.0",
41
+ "@friggframework/eslint-config": "2.0.0--canary.623.1559ce4.0",
42
+ "@friggframework/prettier-config": "2.0.0--canary.623.1559ce4.0",
43
+ "@friggframework/test": "2.0.0--canary.623.1559ce4.0",
44
44
  "@prisma/client": "^6.19.3",
45
45
  "@types/lodash": "4.17.15",
46
46
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "ee3bde8d1adc7e90a424a26429ce4b4d612ff52f"
83
+ "gitHead": "1559ce4d80ee5e97fe0809a5daf4fd02de1da7a7"
84
84
  }