http-request-manager 18.13.30 → 18.13.31

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.
@@ -5148,6 +5148,7 @@ class LocalStorageManagerService extends ComponentStore {
5148
5148
  ? data.localStores.find(item => item.id === foundStore.id)
5149
5149
  : data.sessionStores.find(item => item.id === foundStore.id);
5150
5150
  if (!found) {
5151
+ console.warn('[CacheDebug] store$: settings entry found but no data entry in localStores/sessionStores', { store, foundStoreId: foundStore.id, storageType: foundStore.options?.storage });
5151
5152
  this.deleteStore({ name: store });
5152
5153
  return;
5153
5154
  }
@@ -6200,7 +6201,6 @@ class QueryParamsTrackerService {
6200
6201
  constructor() {
6201
6202
  this.state = { paths: {} };
6202
6203
  this.stateRestored = false;
6203
- this.restoreInProgress = false;
6204
6204
  this.localStorageManager = inject(LocalStorageManagerService);
6205
6205
  }
6206
6206
  clearTracking(resetSessionInit = false) {
@@ -6452,10 +6452,10 @@ class QueryParamsTrackerService {
6452
6452
  return this.state.paths[pathKey];
6453
6453
  }
6454
6454
  ensureStateRestored() {
6455
- if (this.stateRestored || this.restoreInProgress) {
6455
+ if (this.stateRestored) {
6456
6456
  return;
6457
6457
  }
6458
- this.restoreInProgress = true;
6458
+ this.stateRestored = true;
6459
6459
  this.restoreState();
6460
6460
  }
6461
6461
  restoreState() {
@@ -6466,17 +6466,12 @@ class QueryParamsTrackerService {
6466
6466
  if (this.isTrackerState(storedState)) {
6467
6467
  this.state = QueryTrackerStateModel.adapt(storedState);
6468
6468
  this.cleanupExpiredEntries();
6469
+ return;
6469
6470
  }
6470
- else {
6471
- this.state = { paths: {} };
6472
- }
6473
- this.stateRestored = true;
6474
- this.restoreInProgress = false;
6471
+ this.state = { paths: {} };
6475
6472
  },
6476
6473
  error: () => {
6477
6474
  this.state = { paths: {} };
6478
- this.stateRestored = true;
6479
- this.restoreInProgress = false;
6480
6475
  }
6481
6476
  });
6482
6477
  }
@@ -7053,6 +7048,7 @@ class HTTPManagerStateService extends ComponentStore {
7053
7048
  }));
7054
7049
  }
7055
7050
  return this.localStorageManagerService.store$(this.databaseOptions.table).pipe(take(1), switchMap((storeData) => {
7051
+ console.log('[CacheDebug] storeData for table:', this.databaseOptions.table, { storeData, requestCache: storeData?.requestCache, expires: storeData?.expires });
7056
7052
  const forceRefresh = !!options?.forceRefresh;
7057
7053
  const storedSchemaSignature = this.getStoredSchemaSignature(storeData);
7058
7054
  const expires = storeData?.expires || 0;
@@ -7065,6 +7061,7 @@ class HTTPManagerStateService extends ComponentStore {
7065
7061
  }
7066
7062
  const expectedSchema = this.buildSchemaFromAdapter();
7067
7063
  const expectedSchemaSignature = this.buildSchemaSignature(expectedSchema);
7064
+ console.log('[CacheDebug] schema check:', { tableName: this.databaseOptions.table, storedSchemaSignature, expectedSchemaSignature, mismatch: storedSchemaSignature && storedSchemaSignature !== expectedSchemaSignature });
7068
7065
  if (storedSchemaSignature && storedSchemaSignature !== expectedSchemaSignature) {
7069
7066
  const tableDef = TableSchemaDef.adapt({ table: this.databaseOptions.table, schema: expectedSchema });
7070
7067
  return this.dbManagerService.clearTable(this.databaseOptions.table).pipe(switchMap(() => this.dbManagerService.createDatabaseTable(tableDef)), switchMap(() => fetchFromAPI()));
@@ -8227,7 +8224,9 @@ class HTTPManagerStateService extends ComponentStore {
8227
8224
  const normalized = this.trackerNormalizePath(path);
8228
8225
  const ignoreQueryParams = Array.isArray(options?.ignoreQueryParams) ? options.ignoreQueryParams : [];
8229
8226
  if (!normalized.hasQuery || ignoreQueryParams.length === 0) {
8230
- return !this.getRequestCacheMetadata(storeData, 'GET');
8227
+ const meta = this.getRequestCacheMetadata(storeData, 'GET');
8228
+ console.log('[CacheDebug] checkTrackerAllowsRequest: no query params path', { tableName, requestCacheMeta: meta, allowsRequest: !meta });
8229
+ return !meta;
8231
8230
  }
8232
8231
  const filtered = this.trackerFilterQuery(normalized.query, ignoreQueryParams);
8233
8232
  const keys = Object.keys(filtered);