@social-mail/social-mail-web-server 1.7.718 → 1.7.720

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": "@social-mail/social-mail-web-server",
3
- "version": "1.7.718",
3
+ "version": "1.7.720",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -45,6 +45,9 @@ export default class AppTempFileService {
45
45
  async copyFolder(root: AppTempFile, path: string, appFolder: AppFile, currentPath: string) {
46
46
  const rootID = root.tempFileID;
47
47
  const destFolderID = appFolder.appFileID;
48
+
49
+ console.log(`Copying folder ${path} to ${appFolder.path} - ${appFolder.appFileID} - ${appFolder.parentID}`);
50
+
48
51
  const children = await this.db.appTempFiles
49
52
  .where({rootID, path: `${path}%`, pathLength: path.length }, (p) => (x) =>
50
53
  x.rootID === p.rootID
@@ -101,6 +104,7 @@ export default class AppTempFileService {
101
104
  size += BigInt(existing.fileSize);
102
105
 
103
106
  const newPath = `${currentPath}${existing.appFileID}/`;
107
+ existing.path = newPath;
104
108
 
105
109
  // console.log(`Copied ${newPath} from ${path}${child.name}`);
106
110
 
@@ -11,6 +11,7 @@ import UpdateFolderSize from "../storage/files/UpdateFolderSize.js";
11
11
  import WebSite from "../../model/entities/WebSite.js";
12
12
  import FetchBuilder from "@web-atoms/fetch-builder";
13
13
  import AppTempFileService from "../../services/app-temp-file/AppTempFileService.js";
14
+ import sleep from "../../../common/sleep.js";
14
15
 
15
16
 
16
17
  export default class CopyTemplateWorkflow extends Workflow<{ folderID, templateID, publish?: boolean }> {
@@ -38,6 +39,14 @@ export default class CopyTemplateWorkflow extends Workflow<{ folderID, templateI
38
39
  .include((x) => x.folder)
39
40
  .first();
40
41
 
42
+ while(true) {
43
+ const folder = await db.appFiles.where(site, (p) => (x) => x.appFileID === p.folderID).first();
44
+ if (folder.path) {
45
+ break;
46
+ }
47
+ await sleep(1000);
48
+ }
49
+
41
50
  let sourceUrl = void 0 as string;
42
51
 
43
52
  if (/^https?\:\/\//i.test(templateID)) {