@carbonorm/carbonreact 3.5.0 → 3.5.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.
package/dist/index.esm.js CHANGED
@@ -4116,18 +4116,25 @@ function initiateWebsocket({ TABLES = undefined, WsLiveUpdates = undefined, url
4116
4116
  const primaryKeyKeys = Object.keys(REQUEST_PRIMARY_KEY);
4117
4117
  const elementsToUpdate = currentCache.filter((row) => {
4118
4118
  for (const element of primaryKeyKeys) {
4119
+ console.log('element', element, REQUEST_PRIMARY_KEY[element], row[element]);
4119
4120
  if (REQUEST_PRIMARY_KEY[element] !== row[element]) {
4120
4121
  return false;
4121
4122
  }
4122
4123
  }
4123
4124
  return true;
4124
4125
  });
4126
+ console.log('elementsToUpdate', elementsToUpdate);
4127
+ if (elementsToUpdate.length === 0) {
4128
+ console.error('Could not find any elements to update in the cache.', elementsToUpdate, primaryKeyKeys, REQUEST_PRIMARY_KEY, currentCache);
4129
+ return;
4130
+ }
4125
4131
  const updatedElements = elementsToUpdate.map((row) => {
4126
4132
  return {
4127
4133
  ...row,
4128
4134
  ...REQUEST
4129
4135
  };
4130
4136
  });
4137
+ console.log('updatedElements', updatedElements);
4131
4138
  WsLiveUpdates[TABLE_NAME_SHORT][METHOD]({}, updatedElements);
4132
4139
  }
4133
4140
  });