http-request-manager 18.16.0 → 18.16.1
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.
|
@@ -8110,6 +8110,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8110
8110
|
this._requestCachePaths.set(tableName, this.resolvePath(options?.path).filter(p => typeof p === 'string' || typeof p === 'number').map(String));
|
|
8111
8111
|
this.localStorageManagerService.store$(tableName).pipe(take(1), tap((storeData) => {
|
|
8112
8112
|
const currentCache = storeData?.requestCache || {};
|
|
8113
|
+
const currentEntry = currentCache[type] || {};
|
|
8113
8114
|
this.localStorageManagerService.updateStore({
|
|
8114
8115
|
name: tableName,
|
|
8115
8116
|
data: {
|
|
@@ -8117,11 +8118,13 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8117
8118
|
requestCache: {
|
|
8118
8119
|
...currentCache,
|
|
8119
8120
|
[type]: {
|
|
8120
|
-
...
|
|
8121
|
+
...currentEntry,
|
|
8121
8122
|
signature,
|
|
8122
8123
|
savedAt: Date.now(),
|
|
8123
8124
|
path: this.resolvePath(options?.path),
|
|
8124
|
-
headers: this.filterHeaders(options?.headers)
|
|
8125
|
+
headers: this.filterHeaders(options?.headers),
|
|
8126
|
+
queryParams: currentEntry.queryParams,
|
|
8127
|
+
queryParamsExpires: currentEntry.queryParamsExpires,
|
|
8125
8128
|
}
|
|
8126
8129
|
}
|
|
8127
8130
|
}
|
|
@@ -8263,12 +8266,53 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8263
8266
|
const ignoreQueryParams = Array.isArray(options?.ignoreQueryParams) ? options.ignoreQueryParams : [];
|
|
8264
8267
|
if (!normalized.hasQuery) {
|
|
8265
8268
|
const meta = this.getRequestCacheMetadata(storeData, type);
|
|
8269
|
+
if (!meta) {
|
|
8270
|
+
// No prior cache entry — record that we're tracking this request
|
|
8271
|
+
this.setCachedRequestSignature(tableName, type, '');
|
|
8272
|
+
this.localStorageManagerService.store$(tableName).pipe(take(1), tap((s) => {
|
|
8273
|
+
const currentCache = s?.requestCache || {};
|
|
8274
|
+
this.localStorageManagerService.updateStore({
|
|
8275
|
+
name: tableName,
|
|
8276
|
+
data: {
|
|
8277
|
+
...(s || {}),
|
|
8278
|
+
requestCache: {
|
|
8279
|
+
...currentCache,
|
|
8280
|
+
[type]: {
|
|
8281
|
+
...(currentCache[type] || {}),
|
|
8282
|
+
active: true,
|
|
8283
|
+
}
|
|
8284
|
+
}
|
|
8285
|
+
}
|
|
8286
|
+
});
|
|
8287
|
+
})).subscribe();
|
|
8288
|
+
}
|
|
8266
8289
|
return of(!meta);
|
|
8267
8290
|
}
|
|
8268
8291
|
const filtered = this.trackerFilterQuery(normalized.query, ignoreQueryParams);
|
|
8269
8292
|
const keys = Object.keys(filtered);
|
|
8270
8293
|
if (keys.length === 0) {
|
|
8271
|
-
|
|
8294
|
+
// All query params were filtered out — check if we have any prior entry
|
|
8295
|
+
const meta = this.getRequestCacheMetadata(storeData, type);
|
|
8296
|
+
if (!meta) {
|
|
8297
|
+
this.setCachedRequestSignature(tableName, type, '');
|
|
8298
|
+
this.localStorageManagerService.store$(tableName).pipe(take(1), tap((s) => {
|
|
8299
|
+
const currentCache = s?.requestCache || {};
|
|
8300
|
+
this.localStorageManagerService.updateStore({
|
|
8301
|
+
name: tableName,
|
|
8302
|
+
data: {
|
|
8303
|
+
...(s || {}),
|
|
8304
|
+
requestCache: {
|
|
8305
|
+
...currentCache,
|
|
8306
|
+
[type]: {
|
|
8307
|
+
...(currentCache[type] || {}),
|
|
8308
|
+
active: true,
|
|
8309
|
+
}
|
|
8310
|
+
}
|
|
8311
|
+
}
|
|
8312
|
+
});
|
|
8313
|
+
})).subscribe();
|
|
8314
|
+
}
|
|
8315
|
+
return of(!meta);
|
|
8272
8316
|
}
|
|
8273
8317
|
const meta = this.getRequestCacheMetadata(storeData, type) || {};
|
|
8274
8318
|
const now = Math.floor(Date.now() / 1000);
|