@signalium/query 1.0.15 → 1.0.17

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,5 +1,20 @@
1
1
  # @signalium/query
2
2
 
3
+ ## 1.0.17
4
+
5
+ ### Patch Changes
6
+
7
+ - b244daa: Fix infinite query cache hydration and Hermes Uint32Array compatibility
8
+
9
+ - Fix Hermes (React Native) compatibility by spreading Set to Array before Uint32Array conversion, which prevents empty refIds buffers
10
+ - Fix infinite query cache loading by properly handling the array of pages when parsing entities, ensuring entity proxies resolve correctly after app restart
11
+
12
+ ## 1.0.16
13
+
14
+ ### Patch Changes
15
+
16
+ - 4a3bc06: Fix union parseValue check
17
+
3
18
  ## 1.0.15
4
19
 
5
20
  ### Patch Changes
@@ -303,7 +303,7 @@ function defineUnion(...types) {
303
303
  return new ValidatorDef(2, mask | Mask.UNION, void 0, values);
304
304
  }
305
305
  if (shape === void 0) {
306
- return ValidatorDef.cloneWith(definition, mask | Mask.UNION, values);
306
+ return ValidatorDef.cloneWith(definition, mask, values);
307
307
  }
308
308
  return new ValidatorDef(1, mask | Mask.UNION, shape, values);
309
309
  }
@@ -846,7 +846,7 @@ function parseValue(value, propDef, path, skipFallbacks = false, warn = noopWarn
846
846
  }
847
847
  return value;
848
848
  }
849
- if ((valueType & Mask.UNION) !== 0) {
849
+ if ((propMask & Mask.UNION) !== 0) {
850
850
  return parseUnionValue(
851
851
  valueType,
852
852
  value,
@@ -1846,7 +1846,17 @@ class QueryResultImpl {
1846
1846
  );
1847
1847
  }
1848
1848
  const shape = this.def.shape;
1849
- state.value = shape instanceof ValidatorDef ? parseEntities(cached.value, shape, this.queryClient, /* @__PURE__ */ new Set()) : parseValue(cached.value, shape, this.def.id);
1849
+ if (shape instanceof ValidatorDef) {
1850
+ if (this.def.type === QueryType.InfiniteQuery && Array.isArray(cached.value)) {
1851
+ state.value = cached.value.map(
1852
+ (page) => parseEntities(page, shape, this.queryClient, /* @__PURE__ */ new Set())
1853
+ );
1854
+ } else {
1855
+ state.value = parseEntities(cached.value, shape, this.queryClient, /* @__PURE__ */ new Set());
1856
+ }
1857
+ } else {
1858
+ state.value = parseValue(cached.value, shape, this.def.id);
1859
+ }
1850
1860
  }
1851
1861
  } catch (error) {
1852
1862
  this.queryClient.deleteCachedQuery(this.storageKey);