@salesforce/lds-runtime-mobile 1.134.3 → 1.134.4

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/dist/main.js CHANGED
@@ -626,10 +626,8 @@ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
626
626
  * will refresh the snapshot from network, and then run the results from network
627
627
  * through L2 ingestion, returning the subsequent revived snapshot.
628
628
  */
629
- function reviveSnapshot(baseEnvironment, durableStore,
630
- // TODO [W-10165787]: We should only allow Unfulfilled snapshot be passed in
631
- unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics = { l2Trips: [] }) {
632
- const { recordId, select, seenRecords, state } = unavailableSnapshot;
629
+ function reviveSnapshot(baseEnvironment, durableStore, unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics = { l2Trips: [] }) {
630
+ const { recordId, select, missingLinks, seenRecords, state } = unavailableSnapshot;
633
631
  // L2 can only revive Unfulfilled snapshots that have a selector since they have the
634
632
  // info needed to revive (like missingLinks) and rebuild. Otherwise return L1 snapshot.
635
633
  if (state !== 'Unfulfilled' || select === undefined) {
@@ -642,6 +640,7 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
642
640
  // we attempt to read all keys from L2 - so combine recordId with any seenRecords
643
641
  const keysToReviveSet = new StoreKeySet().add(recordId);
644
642
  keysToReviveSet.merge(seenRecords);
643
+ keysToReviveSet.merge(missingLinks);
645
644
  const keysToRevive = keysToReviveSet.keysAsArray();
646
645
  const canonicalKeys = keysToRevive.map((x) => serializeStructuredKey(baseEnvironment.storeGetCanonicalKey(x)));
647
646
  const start = Date.now();
@@ -675,10 +674,11 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
675
674
  if (snapshot.state === 'Unfulfilled') {
676
675
  // have to check if the new snapshot has any additional seenRecords
677
676
  // and revive again if so
678
- const { seenRecords: newSnapshotSeenRecords, recordId: newSnapshotRecordId } = snapshot;
677
+ const { seenRecords: newSnapshotSeenRecords, missingLinks: newSnapshotMissingLinks, recordId: newSnapshotRecordId, } = snapshot;
679
678
  const newKeysToReviveSet = new StoreKeySet();
680
679
  newKeysToReviveSet.add(newSnapshotRecordId);
681
680
  newKeysToReviveSet.merge(newSnapshotSeenRecords);
681
+ newKeysToReviveSet.merge(newSnapshotMissingLinks);
682
682
  const newKeys = newKeysToReviveSet.keysAsArray();
683
683
  // in case DS returned additional entries we combine the requested
684
684
  // and returned keys
@@ -15745,4 +15745,4 @@ register({
15745
15745
  });
15746
15746
 
15747
15747
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15748
- // version: 1.134.3-d4637e557
15748
+ // version: 1.134.4-b3535d2e7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.134.3",
3
+ "version": "1.134.4",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
package/sfdc/main.js CHANGED
@@ -626,10 +626,8 @@ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
626
626
  * will refresh the snapshot from network, and then run the results from network
627
627
  * through L2 ingestion, returning the subsequent revived snapshot.
628
628
  */
629
- function reviveSnapshot(baseEnvironment, durableStore,
630
- // TODO [W-10165787]: We should only allow Unfulfilled snapshot be passed in
631
- unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics = { l2Trips: [] }) {
632
- const { recordId, select, seenRecords, state } = unavailableSnapshot;
629
+ function reviveSnapshot(baseEnvironment, durableStore, unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics = { l2Trips: [] }) {
630
+ const { recordId, select, missingLinks, seenRecords, state } = unavailableSnapshot;
633
631
  // L2 can only revive Unfulfilled snapshots that have a selector since they have the
634
632
  // info needed to revive (like missingLinks) and rebuild. Otherwise return L1 snapshot.
635
633
  if (state !== 'Unfulfilled' || select === undefined) {
@@ -642,6 +640,7 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
642
640
  // we attempt to read all keys from L2 - so combine recordId with any seenRecords
643
641
  const keysToReviveSet = new StoreKeySet().add(recordId);
644
642
  keysToReviveSet.merge(seenRecords);
643
+ keysToReviveSet.merge(missingLinks);
645
644
  const keysToRevive = keysToReviveSet.keysAsArray();
646
645
  const canonicalKeys = keysToRevive.map((x) => serializeStructuredKey(baseEnvironment.storeGetCanonicalKey(x)));
647
646
  const start = Date.now();
@@ -675,10 +674,11 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
675
674
  if (snapshot.state === 'Unfulfilled') {
676
675
  // have to check if the new snapshot has any additional seenRecords
677
676
  // and revive again if so
678
- const { seenRecords: newSnapshotSeenRecords, recordId: newSnapshotRecordId } = snapshot;
677
+ const { seenRecords: newSnapshotSeenRecords, missingLinks: newSnapshotMissingLinks, recordId: newSnapshotRecordId, } = snapshot;
679
678
  const newKeysToReviveSet = new StoreKeySet();
680
679
  newKeysToReviveSet.add(newSnapshotRecordId);
681
680
  newKeysToReviveSet.merge(newSnapshotSeenRecords);
681
+ newKeysToReviveSet.merge(newSnapshotMissingLinks);
682
682
  const newKeys = newKeysToReviveSet.keysAsArray();
683
683
  // in case DS returned additional entries we combine the requested
684
684
  // and returned keys
@@ -15745,4 +15745,4 @@ register({
15745
15745
  });
15746
15746
 
15747
15747
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15748
- // version: 1.134.3-d4637e557
15748
+ // version: 1.134.4-b3535d2e7