cozy-client 32.2.6 → 32.2.7

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.
@@ -2550,7 +2550,7 @@ var CozyClient = /*#__PURE__*/function () {
2550
2550
  CozyClient.hooks = CozyClient.hooks || {};
2551
2551
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2552
2552
 
2553
- CozyClient.version = "32.2.6";
2553
+ CozyClient.version = "32.2.7";
2554
2554
 
2555
2555
  _microee.default.mixin(CozyClient);
2556
2556
 
@@ -192,7 +192,7 @@ var extractAndMergeDocument = function extractAndMergeDocument(data, updatedStat
192
192
  var id = (0, _helpers.properId)(data);
193
193
 
194
194
  if (mergedData[doctype][id]) {
195
- mergedData[doctype][id] = (0, _merge.default)(mergedData[doctype][id], data);
195
+ mergedData[doctype][id] = (0, _merge.default)({}, mergedData[doctype][id], data);
196
196
  } else {
197
197
  mergedData[doctype][id] = data;
198
198
  }
@@ -148,7 +148,24 @@ describe('extractAndMerge', () => {
148
148
  ).toBeFalsy()
149
149
  }
150
150
  )
151
+ it(
152
+ 'should assign a new object for doctype[id] of document to update' +
153
+ 'in order to allow selector to recompute their data when documents are updated',
154
+ () => {
155
+ const returnedDatas = extractAndMergeDocument(
156
+ data,
157
+ updatedStateWithIncluded
158
+ )
151
159
 
160
+ // Then
161
+ expect(
162
+ returnedDatas['io.cozy.files']['b6ff135b34e041ffb2d4a4865f3e0a53'] ===
163
+ updatedStateWithIncluded['io.cozy.files'][
164
+ 'b6ff135b34e041ffb2d4a4865f3e0a53'
165
+ ]
166
+ ).toBeFalsy()
167
+ }
168
+ )
152
169
  it(
153
170
  'should assign a new object for doctype of document to update' +
154
171
  'even if the mergedData is the same, because reselect createSelector update ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "32.2.6",
3
+ "version": "32.2.7",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "2bdb42a6c99bc5383e753c4188090f55ea0ffd08"
76
+ "gitHead": "7fface7b6a57f5f98d334162e95b30c94fbc03f1"
77
77
  }