Skip to content

Commit

Permalink
fix: ensure settled action result before fetching it [PHX-2608]
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolink committed May 9, 2023
1 parent 76f7351 commit fb8a352
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
9 changes: 3 additions & 6 deletions lib/cmds/merge_cmds/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Listr from 'listr'
import path from 'path'
import type { Argv } from 'yargs'
import {
callCreateChangeset,
callCreateChangesetWithResponse,
getExportMigration
} from '../../utils/app-actions'
import { getAppActionId, type Host } from '../../utils/app-actions-config'
Expand Down Expand Up @@ -89,7 +89,7 @@ export const callExportAppAction = async ({
// use wrapTask
task: async (ctx: Context, task) => {
task.output = chalk`calculating differences`
const actionResponse = await callCreateChangeset({
const actionResponse = await callCreateChangesetWithResponse({
api: ctx.api,
appDefinitionId: ctx.appDefinitionId,
appActionId: ctx.createChangesetActionId,
Expand All @@ -107,11 +107,8 @@ export const callExportAppAction = async ({
})

task.output = chalk`fetching differences`
// wait for changeset to be settled
await new Promise(resolve => setTimeout(resolve, 1000 * 8))
// eslint-disable-next-line require-atomic-updates
ctx.changesetRef = actionResponse
// ctx.changesetRef = actionResponse.sys.id
ctx.changesetRef = actionResponse.sys.id
}
},
{
Expand Down
14 changes: 7 additions & 7 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
Expand Up @@ -92,7 +92,7 @@
"contentful-collection": "^0.0.4",
"contentful-export": "^7.19.0",
"contentful-import": "^8.5.35",
"contentful-management": "^10.33.0",
"contentful-management": "^10.35.3",
"contentful-migration": "^4.12.5",
"emojic": "^1.1.11",
"execa": "^5.0.0",
Expand Down

0 comments on commit fb8a352

Please sign in to comment.