@salesforce/lds-runtime-mobile 1.114.0 → 1.114.2

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.
@@ -20,7 +20,7 @@ export declare class NimbusDraftQueue implements DraftQueue {
20
20
  startQueue(): Promise<void>;
21
21
  stopQueue(): Promise<void>;
22
22
  replaceAction(_actionId: string, _withActionId: string): Promise<DraftAction<unknown, unknown>>;
23
- mergeAction<Data, Response>(_targetActionId: string, _sourceActionId: string): Promise<DraftAction<Data, Response>>;
23
+ mergeActions<Data, Response>(_targetActionId: string, _sourceActionId: string): Promise<DraftAction<Data, Response>>;
24
24
  setMetadata(_actionId: string, _metadata: DraftActionMetadata): Promise<DraftAction<unknown, unknown>>;
25
25
  addHandler(_handler: ActionHandler<unknown, unknown, unknown>): Promise<void>;
26
26
  addCustomHandler(_id: string, _executor: CustomActionExecutor): Promise<void>;
package/dist/main.js CHANGED
@@ -5166,23 +5166,31 @@ class DurableDraftQueue {
5166
5166
  await this.startQueueSafe();
5167
5167
  return Promise.reject('No action to replace');
5168
5168
  }
5169
- const { actionToReplace, replacingAction } = this.getHandler(first.handler).handleReplaceAction(actionId, withActionId, this.uploadingActionId, actions);
5170
- // TODO [W-8873834]: Will add batching support to durable store
5171
- // we should use that here to remove and set both actions in one operation
5172
- await this.removeDraftAction(replacingAction.id);
5173
- await this.draftStore.writeAction(actionToReplace);
5174
- await this.notifyChangedListeners({
5175
- type: DraftQueueEventType.ActionUpdated,
5176
- action: actionToReplace,
5177
- });
5178
- this.replacingAction = undefined;
5169
+ // put in a try/finally block so we don't leave this.replacingAction
5170
+ // indefinitely set
5171
+ let actionToReplace;
5172
+ try {
5173
+ const replaceResult = this.getHandler(first.handler).handleReplaceAction(actionId, withActionId, this.uploadingActionId, actions);
5174
+ actionToReplace = replaceResult.actionToReplace;
5175
+ // TODO [W-8873834]: Will add batching support to durable store
5176
+ // we should use that here to remove and set both actions in one operation
5177
+ await this.removeDraftAction(replaceResult.replacingAction.id);
5178
+ await this.draftStore.writeAction(actionToReplace);
5179
+ await this.notifyChangedListeners({
5180
+ type: DraftQueueEventType.ActionUpdated,
5181
+ action: actionToReplace,
5182
+ });
5183
+ }
5184
+ finally {
5185
+ this.replacingAction = undefined;
5186
+ }
5179
5187
  await this.startQueueSafe();
5180
5188
  return actionToReplace;
5181
5189
  });
5182
5190
  this.replacingAction = replacing;
5183
5191
  return replacing;
5184
5192
  }
5185
- mergeAction(targetActionId, sourceActionId) {
5193
+ mergeActions(targetActionId, sourceActionId) {
5186
5194
  // ids must be unique
5187
5195
  if (targetActionId === sourceActionId) {
5188
5196
  return Promise.reject(new Error('target and source action ids cannot be the same'));
@@ -5205,16 +5213,23 @@ class DurableDraftQueue {
5205
5213
  await this.startQueueSafe();
5206
5214
  throw Error('No action to replace');
5207
5215
  }
5208
- const merged = this.getHandler(target.handler).mergeActions(target, source);
5209
- // update the target
5210
- await this.draftStore.writeAction(merged);
5211
- await this.notifyChangedListeners({
5212
- type: DraftQueueEventType.ActionUpdated,
5213
- action: merged,
5214
- });
5215
- // remove the source from queue
5216
- await this.removeDraftAction(sourceActionId);
5217
- this.replacingAction = undefined;
5216
+ // put in a try/finally block so we don't leave this.replacingAction
5217
+ // indefinitely set
5218
+ let merged;
5219
+ try {
5220
+ merged = this.getHandler(target.handler).mergeActions(target, source);
5221
+ // update the target
5222
+ await this.draftStore.writeAction(merged);
5223
+ await this.notifyChangedListeners({
5224
+ type: DraftQueueEventType.ActionUpdated,
5225
+ action: merged,
5226
+ });
5227
+ // remove the source from queue
5228
+ await this.removeDraftAction(sourceActionId);
5229
+ }
5230
+ finally {
5231
+ this.replacingAction = undefined;
5232
+ }
5218
5233
  await this.startQueueSafe();
5219
5234
  return merged;
5220
5235
  });
@@ -6082,8 +6097,8 @@ class DraftManager {
6082
6097
  * @param sourceActionId The draft action id to merge onto the target. This
6083
6098
  * action will be removed after the merge.
6084
6099
  */
6085
- mergeAction(targetActionId, sourceActionId) {
6086
- return this.draftQueue.mergeAction(targetActionId, sourceActionId).then((merged) => {
6100
+ mergeActions(targetActionId, sourceActionId) {
6101
+ return this.draftQueue.mergeActions(targetActionId, sourceActionId).then((merged) => {
6087
6102
  return this.buildDraftQueueItem(merged);
6088
6103
  });
6089
6104
  }
@@ -13919,8 +13934,8 @@ class NimbusDraftQueue {
13919
13934
  replaceAction(_actionId, _withActionId) {
13920
13935
  return Promise.reject('Cannot call replaceAction from the NimbusDraftQueue');
13921
13936
  }
13922
- mergeAction(_targetActionId, _sourceActionId) {
13923
- return Promise.reject('Cannot call mergeAction from the NimbusDraftQueue');
13937
+ mergeActions(_targetActionId, _sourceActionId) {
13938
+ return Promise.reject('Cannot call mergeActions from the NimbusDraftQueue');
13924
13939
  }
13925
13940
  setMetadata(_actionId, _metadata) {
13926
13941
  return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
@@ -15585,4 +15600,4 @@ register({
15585
15600
  });
15586
15601
 
15587
15602
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15588
- // version: 1.114.0-4ac6a5a61
15603
+ // version: 1.114.2-fe583257a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.114.0",
3
+ "version": "1.114.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,10 +32,10 @@
32
32
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
33
33
  },
34
34
  "dependencies": {
35
- "@salesforce/lds-adapters-uiapi": "^1.114.0",
36
- "@salesforce/lds-bindings": "^1.114.0",
37
- "@salesforce/lds-instrumentation": "^1.114.0",
38
- "@salesforce/lds-priming": "^1.114.0",
35
+ "@salesforce/lds-adapters-uiapi": "^1.114.2",
36
+ "@salesforce/lds-bindings": "^1.114.2",
37
+ "@salesforce/lds-instrumentation": "^1.114.2",
38
+ "@salesforce/lds-priming": "^1.114.2",
39
39
  "@salesforce/user": "0.0.12",
40
40
  "o11y": "244.0.0"
41
41
  },
@@ -43,16 +43,16 @@
43
43
  "@luvio/engine": "0.137.1",
44
44
  "@luvio/environments": "0.137.1",
45
45
  "@luvio/graphql-parser": "0.137.1",
46
- "@salesforce/lds-adapters-graphql": "^1.114.0",
47
- "@salesforce/lds-drafts": "^1.114.0",
48
- "@salesforce/lds-drafts-adapters-uiapi": "^1.114.0",
49
- "@salesforce/lds-graphql-eval": "^1.114.0",
50
- "@salesforce/lds-network-adapter": "^1.114.0",
51
- "@salesforce/lds-network-nimbus": "^1.114.0",
52
- "@salesforce/lds-store-binary": "^1.114.0",
53
- "@salesforce/lds-store-sql": "^1.114.0",
54
- "@salesforce/lds-utils-adapters": "^1.114.0",
55
- "@salesforce/nimbus-plugin-lds": "^1.114.0",
46
+ "@salesforce/lds-adapters-graphql": "^1.114.2",
47
+ "@salesforce/lds-drafts": "^1.114.2",
48
+ "@salesforce/lds-drafts-adapters-uiapi": "^1.114.2",
49
+ "@salesforce/lds-graphql-eval": "^1.114.2",
50
+ "@salesforce/lds-network-adapter": "^1.114.2",
51
+ "@salesforce/lds-network-nimbus": "^1.114.2",
52
+ "@salesforce/lds-store-binary": "^1.114.2",
53
+ "@salesforce/lds-store-sql": "^1.114.2",
54
+ "@salesforce/lds-utils-adapters": "^1.114.2",
55
+ "@salesforce/nimbus-plugin-lds": "^1.114.2",
56
56
  "babel-plugin-dynamic-import-node": "^2.3.3",
57
57
  "wait-for-expect": "^3.0.2"
58
58
  },
@@ -20,7 +20,7 @@ export declare class NimbusDraftQueue implements DraftQueue {
20
20
  startQueue(): Promise<void>;
21
21
  stopQueue(): Promise<void>;
22
22
  replaceAction(_actionId: string, _withActionId: string): Promise<DraftAction<unknown, unknown>>;
23
- mergeAction<Data, Response>(_targetActionId: string, _sourceActionId: string): Promise<DraftAction<Data, Response>>;
23
+ mergeActions<Data, Response>(_targetActionId: string, _sourceActionId: string): Promise<DraftAction<Data, Response>>;
24
24
  setMetadata(_actionId: string, _metadata: DraftActionMetadata): Promise<DraftAction<unknown, unknown>>;
25
25
  addHandler(_handler: ActionHandler<unknown, unknown, unknown>): Promise<void>;
26
26
  addCustomHandler(_id: string, _executor: CustomActionExecutor): Promise<void>;
package/sfdc/main.js CHANGED
@@ -5166,23 +5166,31 @@ class DurableDraftQueue {
5166
5166
  await this.startQueueSafe();
5167
5167
  return Promise.reject('No action to replace');
5168
5168
  }
5169
- const { actionToReplace, replacingAction } = this.getHandler(first.handler).handleReplaceAction(actionId, withActionId, this.uploadingActionId, actions);
5170
- // TODO [W-8873834]: Will add batching support to durable store
5171
- // we should use that here to remove and set both actions in one operation
5172
- await this.removeDraftAction(replacingAction.id);
5173
- await this.draftStore.writeAction(actionToReplace);
5174
- await this.notifyChangedListeners({
5175
- type: DraftQueueEventType.ActionUpdated,
5176
- action: actionToReplace,
5177
- });
5178
- this.replacingAction = undefined;
5169
+ // put in a try/finally block so we don't leave this.replacingAction
5170
+ // indefinitely set
5171
+ let actionToReplace;
5172
+ try {
5173
+ const replaceResult = this.getHandler(first.handler).handleReplaceAction(actionId, withActionId, this.uploadingActionId, actions);
5174
+ actionToReplace = replaceResult.actionToReplace;
5175
+ // TODO [W-8873834]: Will add batching support to durable store
5176
+ // we should use that here to remove and set both actions in one operation
5177
+ await this.removeDraftAction(replaceResult.replacingAction.id);
5178
+ await this.draftStore.writeAction(actionToReplace);
5179
+ await this.notifyChangedListeners({
5180
+ type: DraftQueueEventType.ActionUpdated,
5181
+ action: actionToReplace,
5182
+ });
5183
+ }
5184
+ finally {
5185
+ this.replacingAction = undefined;
5186
+ }
5179
5187
  await this.startQueueSafe();
5180
5188
  return actionToReplace;
5181
5189
  });
5182
5190
  this.replacingAction = replacing;
5183
5191
  return replacing;
5184
5192
  }
5185
- mergeAction(targetActionId, sourceActionId) {
5193
+ mergeActions(targetActionId, sourceActionId) {
5186
5194
  // ids must be unique
5187
5195
  if (targetActionId === sourceActionId) {
5188
5196
  return Promise.reject(new Error('target and source action ids cannot be the same'));
@@ -5205,16 +5213,23 @@ class DurableDraftQueue {
5205
5213
  await this.startQueueSafe();
5206
5214
  throw Error('No action to replace');
5207
5215
  }
5208
- const merged = this.getHandler(target.handler).mergeActions(target, source);
5209
- // update the target
5210
- await this.draftStore.writeAction(merged);
5211
- await this.notifyChangedListeners({
5212
- type: DraftQueueEventType.ActionUpdated,
5213
- action: merged,
5214
- });
5215
- // remove the source from queue
5216
- await this.removeDraftAction(sourceActionId);
5217
- this.replacingAction = undefined;
5216
+ // put in a try/finally block so we don't leave this.replacingAction
5217
+ // indefinitely set
5218
+ let merged;
5219
+ try {
5220
+ merged = this.getHandler(target.handler).mergeActions(target, source);
5221
+ // update the target
5222
+ await this.draftStore.writeAction(merged);
5223
+ await this.notifyChangedListeners({
5224
+ type: DraftQueueEventType.ActionUpdated,
5225
+ action: merged,
5226
+ });
5227
+ // remove the source from queue
5228
+ await this.removeDraftAction(sourceActionId);
5229
+ }
5230
+ finally {
5231
+ this.replacingAction = undefined;
5232
+ }
5218
5233
  await this.startQueueSafe();
5219
5234
  return merged;
5220
5235
  });
@@ -6082,8 +6097,8 @@ class DraftManager {
6082
6097
  * @param sourceActionId The draft action id to merge onto the target. This
6083
6098
  * action will be removed after the merge.
6084
6099
  */
6085
- mergeAction(targetActionId, sourceActionId) {
6086
- return this.draftQueue.mergeAction(targetActionId, sourceActionId).then((merged) => {
6100
+ mergeActions(targetActionId, sourceActionId) {
6101
+ return this.draftQueue.mergeActions(targetActionId, sourceActionId).then((merged) => {
6087
6102
  return this.buildDraftQueueItem(merged);
6088
6103
  });
6089
6104
  }
@@ -13919,8 +13934,8 @@ class NimbusDraftQueue {
13919
13934
  replaceAction(_actionId, _withActionId) {
13920
13935
  return Promise.reject('Cannot call replaceAction from the NimbusDraftQueue');
13921
13936
  }
13922
- mergeAction(_targetActionId, _sourceActionId) {
13923
- return Promise.reject('Cannot call mergeAction from the NimbusDraftQueue');
13937
+ mergeActions(_targetActionId, _sourceActionId) {
13938
+ return Promise.reject('Cannot call mergeActions from the NimbusDraftQueue');
13924
13939
  }
13925
13940
  setMetadata(_actionId, _metadata) {
13926
13941
  return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
@@ -15585,4 +15600,4 @@ register({
15585
15600
  });
15586
15601
 
15587
15602
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15588
- // version: 1.114.0-4ac6a5a61
15603
+ // version: 1.114.2-fe583257a