@salesforce/lds-drafts 1.428.0-dev2 → 1.429.0

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.
Files changed (2) hide show
  1. package/dist/ldsDrafts.js +10 -0
  2. package/package.json +5 -5
package/dist/ldsDrafts.js CHANGED
@@ -363,6 +363,13 @@ class DurableDraftQueue {
363
363
  // has last set the queue to be started
364
364
  return;
365
365
  }
366
+ // This is important because if there is a dangling timeout handler
367
+ // it can fire on an empty queue, marking it as waiting, and then
368
+ // not add another timeout handler to restart it
369
+ if (this.timeoutHandler) {
370
+ clearTimeout(this.timeoutHandler);
371
+ this.timeoutHandler = undefined;
372
+ }
366
373
  this.retryIntervalMilliseconds = 0;
367
374
  this.state = DraftQueueState.Started;
368
375
  await this.notifyChangedListeners({
@@ -519,6 +526,9 @@ class DurableDraftQueue {
519
526
  const queue = await this.getQueueActions();
520
527
  const action = queue[0];
521
528
  if (action === undefined) {
529
+ if (this.state === DraftQueueState.Waiting) {
530
+ this.state = DraftQueueState.Started;
531
+ }
522
532
  this.processingAction = undefined;
523
533
  return ProcessActionResult.NO_ACTION_TO_PROCESS;
524
534
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-drafts",
3
- "version": "1.428.0-dev2",
3
+ "version": "1.429.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS Drafts",
6
6
  "main": "dist/ldsDrafts.js",
@@ -24,12 +24,12 @@
24
24
  "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-drafts"
25
25
  },
26
26
  "dependencies": {
27
- "@luvio/engine": "0.160.3",
28
- "@luvio/environments": "0.160.3",
29
- "@salesforce/lds-utils-adapters": "^1.428.0-dev2"
27
+ "@luvio/engine": "0.160.4",
28
+ "@luvio/environments": "0.160.4",
29
+ "@salesforce/lds-utils-adapters": "^1.429.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@salesforce/nimbus-plugin-lds": "^1.428.0-dev2"
32
+ "@salesforce/nimbus-plugin-lds": "^1.429.0"
33
33
  },
34
34
  "volta": {
35
35
  "extends": "../../package.json"