-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dev when resetting and creating a new app #5213
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,7 +310,12 @@ describe('createApp', () => { | |
publicApiVersions: [{handle: '2024-07'}, {handle: '2024-10'}, {handle: '2025-01'}, {handle: 'unstable'}], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a test that ensures we dont run into |
||
} | ||
vi.mocked(webhooksRequest).mockResolvedValueOnce(mockedApiVersionResult) | ||
vi.mocked(appManagementRequestDoc).mockResolvedValueOnce({appCreate: {app: {id: '1', key: 'key'}, userErrors: []}}) | ||
vi.mocked(appManagementRequestDoc).mockResolvedValueOnce({ | ||
appCreate: { | ||
app: {id: '1', key: 'key', activeRoot: {clientCredentials: {secrets: [{key: 'secret'}]}}}, | ||
userErrors: [], | ||
}, | ||
}) | ||
|
||
// When | ||
client.token = () => Promise.resolve('token') | ||
|
@@ -347,7 +352,7 @@ describe('createApp', () => { | |
id: '1', | ||
key: 'api-key', | ||
apiKey: 'api-key', | ||
apiSecretKeys: [], | ||
apiSecretKeys: [{secret: 'secret'}], | ||
flags: [], | ||
grantedScopes: [], | ||
organizationId: '1', | ||
|
@@ -364,6 +369,11 @@ describe('createApp', () => { | |
app: { | ||
id: expectedApp.id, | ||
key: expectedApp.key, | ||
activeRoot: { | ||
clientCredentials: { | ||
secrets: [{key: 'secret'}], | ||
}, | ||
}, | ||
}, | ||
userErrors: [], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,11 +390,12 @@ | |
// Need to figure this out still | ||
const flags = filterDisabledFlags([]) | ||
const createdApp = result.appCreate.app | ||
const apiSecretKeys = createdApp.activeRoot.clientCredentials.secrets.map((secret) => ({secret: secret.key})) | ||
return { | ||
...createdApp, | ||
title: name, | ||
apiKey: createdApp.key, | ||
apiSecretKeys: [], | ||
apiSecretKeys, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this ever return an empty array? If it does, will we run into the same issue again? |
||
grantedScopes: options?.scopesArray ?? [], | ||
organizationId: org.id, | ||
newApp: true, | ||
|
@@ -430,7 +431,7 @@ | |
appIdentifiers: MinimalAppIdentifiers, | ||
activeAppVersion?: AppVersion, | ||
): Promise<AllAppExtensionRegistrationsQuerySchema> { | ||
const app = activeAppVersion || (await this.activeAppVersion(appIdentifiers)) | ||
Check warning on line 434 in packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts GitHub Actions / ESLint Report Analysispackages/app/src/cli/utilities/developer-platform-client/app-management-client.ts#L434
|
||
|
||
const configurationRegistrations: ExtensionRegistration[] = [] | ||
const extensionRegistrations: ExtensionRegistration[] = [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unclear how fixes the issue with missing
apiSecretKey
onshopify app dev --reset
. Is this saying we always create a new app with the default options? Why was the!isCurrentAppSchema(configuration)
check removed?