goblin-desktop 2.0.20 → 2.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goblin-desktop",
3
- "version": "2.0.20",
3
+ "version": "2.0.21",
4
4
  "description": "Goblin Desktop",
5
5
  "main": "./builders/builders.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@ const StringBuilder = require('goblin-nabu/lib/string-builder.js');
8
8
  const xUtils = require('xcraft-core-utils');
9
9
  const {getFileFilter} = xUtils.files;
10
10
  const {locks} = require('xcraft-core-utils');
11
- const doAddLock = locks.getMutex;
11
+ const desktopLock = locks.getMutex;
12
12
  // Define initial logic values
13
13
  const logicState = {};
14
14
 
@@ -154,6 +154,10 @@ Goblin.registerQuest(goblinName, 'removeWorkitem', function* (
154
154
  quest.log.dbg(`Skipping ${workitemId} remove...`);
155
155
  return;
156
156
  }
157
+
158
+ yield desktopLock.lock(workitemId);
159
+ quest.defer(() => desktopLock.unlock(workitemId));
160
+
157
161
  yield quest.doSync({workitemId});
158
162
 
159
163
  const api = quest.getAPI(workitemId);
@@ -314,9 +318,12 @@ Goblin.registerQuest(goblinName, 'add-workitem', function* (
314
318
 
315
319
  quest.log.dbg(`Adding ${widgetId}...`);
316
320
 
317
- yield doAddLock.lock(desktopId);
321
+ yield desktopLock.lock(widgetId);
322
+ quest.defer(() => desktopLock.unlock(widgetId));
323
+
324
+ yield desktopLock.lock(desktopId);
318
325
  const res = yield doAdd(quest, widgetId, clientSessionId, workitem, navigate);
319
- doAddLock.unlock(desktopId);
326
+ desktopLock.unlock(desktopId);
320
327
 
321
328
  if (res.skipped) {
322
329
  quest.log.dbg(`Adding ${widgetId}...[FAILED]`);