@reforgium/statum 3.1.4 → 3.1.5

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [3.1.5]: 2026-04-14
2
+
3
+ ### Fix:
4
+ - `PagedQueryStore`: page cache is now invalidated when `routeParams` change even if `reset: false` is used, so long-lived singleton-like stores do not replay cached pages from the previous logical dataset/session after a screen remount or route-context change
5
+ - `PagedQueryStore.updateConfig(...)` / `copy(...)`: cached page window is now cleared before transport reconfiguration so reused source instances do not leak stale buffered pages into `@reforgium/data-grid` source mode
6
+
7
+ ### Test:
8
+ - added regression coverage for cache invalidation on route-param session changes without store destruction
9
+
10
+ ---
11
+
1
12
  ## [3.1.4]: 2026-04-10
2
13
 
3
14
  ### Fix:
@@ -1007,6 +1007,7 @@ class PagedQueryStore {
1007
1007
  if (!isChanged) {
1008
1008
  return;
1009
1009
  }
1010
+ this.invalidatePageCache();
1010
1011
  this.#routeParams.set(params);
1011
1012
  if (opts.reset) {
1012
1013
  this.resetDataset();
@@ -1028,6 +1029,7 @@ class PagedQueryStore {
1028
1029
  updateConfig = (config) => {
1029
1030
  this.config = { ...this.config, ...config };
1030
1031
  this.#cache.limit = this.resolveCacheLimit();
1032
+ this.invalidatePageCache();
1031
1033
  this.applyPresetMeta();
1032
1034
  this.reinitTransport();
1033
1035
  };
@@ -1036,6 +1038,7 @@ class PagedQueryStore {
1036
1038
  */
1037
1039
  copy(store) {
1038
1040
  this.applyConfig(store.config);
1041
+ this.invalidatePageCache();
1039
1042
  this.applyPresetMeta();
1040
1043
  this.reinitTransport();
1041
1044
  }
@@ -1169,6 +1172,10 @@ class PagedQueryStore {
1169
1172
  }
1170
1173
  this.cached.set(flat);
1171
1174
  };
1175
+ invalidatePageCache() {
1176
+ this.#cache.clear();
1177
+ this.cached.set([]);
1178
+ }
1172
1179
  parseFlatArray(data) {
1173
1180
  return { content: data, totalElements: data.length };
1174
1181
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.1.4",
2
+ "version": "3.1.5",
3
3
  "name": "@reforgium/statum",
4
4
  "description": "Signals-first API state and query stores for Angular",
5
5
  "author": "rtommievich",
@@ -600,6 +600,7 @@ declare class PagedQueryStore<ItemsType extends AnyDict, FilterType extends AnyD
600
600
  private parseQuery;
601
601
  private parseResponseData;
602
602
  private updateCache;
603
+ private invalidatePageCache;
603
604
  private parseFlatArray;
604
605
  private resetDataset;
605
606
  private bumpVersion;