Skip to content

Commit d783c8c

Browse files
committed
fix: scratch org create/resume Id should be orgId, not SOI Id
1 parent bcc7b24 commit d783c8c

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

src/commands/org/create/scratch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
190190
this.logSuccess(messages.getMessage('success'));
191191
}
192192

193-
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo.Id };
193+
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
194194
} catch (error) {
195195
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
196196
this.spinner.stop(lastStatus);

src/commands/org/resume/scratch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ export default class EnvResumeScratch extends SfCommand<ScratchCreateResponse> {
7070

7171
this.log();
7272
this.logSuccess(messages.getMessage('success'));
73-
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo?.Id };
73+
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
7474
}
7575
}

test/nut/async-create-resume.nut.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('env:create:scratch async/resume', () => {
7474
if (resp.status === 0) {
7575
done = true;
7676
expect(resp.result).to.have.all.keys(completeKeys);
77+
expect(resp.result.orgId).to.match(/^00D.{15}/);
7778
} else if (resp.name === 'StillInProgressError') {
7879
// eslint-disable-next-line no-await-in-loop
7980
await sleep(Duration.seconds(30));

test/nut/scratchCreate.nut.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ describe('env create scratch NUTs', () => {
6969
}).jsonOutput?.result;
7070
expect(resp).to.have.all.keys(keys);
7171
assert(resp?.username);
72+
expect(resp?.orgId).to.match(/^00D.{15}/);
7273
const stateAggregator = await StateAggregator.create();
7374
expect(await stateAggregator.orgs.read(resp.username)).to.have.property('tracksSource', true);
7475
StateAggregator.clearInstance();
@@ -81,6 +82,7 @@ describe('env create scratch NUTs', () => {
8182
}
8283
).jsonOutput?.result;
8384
expect(resp).to.have.all.keys(keys);
85+
expect(resp?.orgId).to.match(/^00D.{15}/);
8486
});
8587
it('creates an org from config file with "override" flags ', () => {
8688
const expectedUsername = genUniqueString('%[email protected]');

0 commit comments

Comments
 (0)