@budibase/server 2.20.3 → 2.20.4

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.20.3",
4
+ "version": "2.20.4",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -47,12 +47,12 @@
47
47
  "license": "GPL-3.0",
48
48
  "dependencies": {
49
49
  "@apidevtools/swagger-parser": "10.0.3",
50
- "@budibase/backend-core": "2.20.3",
51
- "@budibase/client": "2.20.3",
52
- "@budibase/pro": "2.20.3",
53
- "@budibase/shared-core": "2.20.3",
54
- "@budibase/string-templates": "2.20.3",
55
- "@budibase/types": "2.20.3",
50
+ "@budibase/backend-core": "2.20.4",
51
+ "@budibase/client": "2.20.4",
52
+ "@budibase/pro": "2.20.4",
53
+ "@budibase/shared-core": "2.20.4",
54
+ "@budibase/string-templates": "2.20.4",
55
+ "@budibase/types": "2.20.4",
56
56
  "@bull-board/api": "5.10.2",
57
57
  "@bull-board/koa": "5.10.2",
58
58
  "@elastic/elasticsearch": "7.10.0",
@@ -192,5 +192,5 @@
192
192
  }
193
193
  }
194
194
  },
195
- "gitHead": "fbfbe40b2e3c16c5b35847e8f60e049301a716f2"
195
+ "gitHead": "1791e493ef1b7bad157eddb723f67437802658e6"
196
196
  }
@@ -8,7 +8,6 @@ import { mocks } from "@budibase/backend-core/tests"
8
8
  mocks.licenses.useBackups()
9
9
 
10
10
  describe("/backups", () => {
11
- let request = setup.getRequest()
12
11
  let config = setup.getConfig()
13
12
 
14
13
  afterAll(setup.afterAll)
@@ -59,10 +58,8 @@ describe("/backups", () => {
59
58
  await config.createScreen()
60
59
  const exportRes = await config.api.backup.createBackup(appId)
61
60
  expect(exportRes.backupId).toBeDefined()
62
- const importRes = await config.api.backup.importBackup(
63
- appId,
64
- exportRes.backupId
65
- )
61
+ await config.api.backup.waitForBackupToComplete(appId, exportRes.backupId)
62
+ await config.api.backup.importBackup(appId, exportRes.backupId)
66
63
  })
67
64
  })
68
65
 
@@ -31,6 +31,19 @@ export class BackupAPI extends TestAPI {
31
31
  return result.body as CreateAppBackupResponse
32
32
  }
33
33
 
34
+ waitForBackupToComplete = async (appId: string, backupId: string) => {
35
+ for (let i = 0; i < 10; i++) {
36
+ await new Promise(resolve => setTimeout(resolve, 1000))
37
+ const result = await this.request
38
+ .get(`/api/apps/${appId}/backups/${backupId}/file`)
39
+ .set(this.config.defaultHeaders())
40
+ if (result.status === 200) {
41
+ return
42
+ }
43
+ }
44
+ throw new Error("Backup did not complete")
45
+ }
46
+
34
47
  importBackup = async (
35
48
  appId: string,
36
49
  backupId: string