Skip to content

Commit

Permalink
fix: refresh without a status
Browse files Browse the repository at this point in the history
  • Loading branch information
abuaboud committed Jul 19, 2023
1 parent 459b781 commit f653cc9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.0'
services:
activepieces:
image: activepieces/activepieces:0.5.0
image: activepieces/activepieces:0.5.1
container_name: activepieces
restart: unless-stopped
## Enable the following line if you already use AP_EXECUTION_MODE with SANDBOXED or old activepieces, checking the breaking change documentation for more info.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "activepieces",
"version": "0.5.0",
"version": "0.5.1",
"scripts": {
"prepare": "husky install",
"docker": "docker compose -f docker-compose.dev.yml up",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EntitySchema } from 'typeorm'
import { ApIdSchema, BaseColumnSchemaPart } from '../helper/base-entity'
import { EncryptedObject } from '../helper/encryption'

export type AppConnectionSchema = Omit<AppConnection, 'value'> & { project: Project, value: EncryptedObject }
export type AppConnectionSchema = Omit<AppConnection, 'value' | 'status'> & { project: Project, value: EncryptedObject }

export const AppConnectionEntity = new EntitySchema<AppConnectionSchema>({
name: 'app_connection',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const appConnectionService = {
name: request.name,
projectId,
})

return decryptConnection(updatedConnection)
},

Expand Down Expand Up @@ -236,30 +235,35 @@ function decryptConnection(
case AppConnectionType.BASIC_AUTH:
connection = {
...encryptedConnection,
status: AppConnectionStatus.ACTIVE,
value,
}
break
case AppConnectionType.CLOUD_OAUTH2:
connection = {
...encryptedConnection,
status: AppConnectionStatus.ACTIVE,
value,
}
break
case AppConnectionType.CUSTOM_AUTH:
connection = {
...encryptedConnection,
status: AppConnectionStatus.ACTIVE,
value,
}
break
case AppConnectionType.OAUTH2:
connection = {
...encryptedConnection,
status: AppConnectionStatus.ACTIVE,
value,
}
break
case AppConnectionType.SECRET_TEXT:
connection = {
...encryptedConnection,
status: AppConnectionStatus.ACTIVE,
value,
}
break
Expand Down Expand Up @@ -335,7 +339,10 @@ async function lockAndRefreshConnection({
}
const refreshedAppConnection = await refresh(appConnection)
await appConnectionRepo.update(refreshedAppConnection.id, {
...refreshedAppConnection,
id: refreshedAppConnection.id,
name: refreshedAppConnection.name,
appName: refreshedAppConnection.appName,
projectId: refreshedAppConnection.projectId,
value: encryptObject(refreshedAppConnection.value),
})
refreshedAppConnection.status = getStatus(refreshedAppConnection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ async function downloadFiles(
logger.info(`[${flowVersion.id}] Acquiring flow lock to build codes`)
const flowLock = await acquireLock({
key: flowVersion.id,
timeout: 60000,
timeout: 180000,
})
try {
const buildPath = sandbox.getSandboxFolderPath()
Expand Down

0 comments on commit f653cc9

Please sign in to comment.