Skip to content
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

Sm/fix is scratch #610

Merged
merged 7 commits into from
Jun 30, 2022
Merged

Sm/fix is scratch #610

merged 7 commits into from
Jun 30, 2022

Conversation

mshanemc
Copy link
Contributor

@salesforce-cla
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): SF-CLI-BOT <s***@g***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce.com Contributor License Agreement and this Pull Request will be revalidated.

@mshanemc mshanemc changed the base branch from main to v3 June 28, 2022 19:12
src/org/org.ts Outdated Show resolved Hide resolved
WillieRuemmele
WillieRuemmele previously approved these changes Jun 28, 2022
@@ -655,7 +655,7 @@ export class Org extends AsyncOptionalCreatable<Org.Options> {
const username = this.getUsername();
if (username) {
const organization = await this.retrieveOrganizationInformation();
const isScratch = organization.IsSandbox && organization.TrialExpirationDate;
const isScratch = organization.IsSandbox && Boolean(organization.TrialExpirationDate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprising that it's not !organization.IsSandbox. Seems like .IsSandbox should not be true when it's a scratch org... so continues the difficulties of determining scratch orgs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also weird that the && in the middle doesn't turn the whole expression into a boolean, thanks JavaScript.
image

Also a place where TypeScript can help 😄
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to the server, isSandbox means, "is it running on sandbox infra?" and therefore scratch orgs are sandboxes.
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm

I know. Not confusing at all

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess IsSandbox ? it's a sandbox : it's a prod org no options for scratch orgs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the enum-based keys, combined with types that extend & JsonMap, that prevented the stateAggregator.orgs.update from catching the type error.

😢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mike fixed some typing elsewhere to prevent this from happening. I merged those in.

RodEsp
RodEsp previously approved these changes Jun 30, 2022
@iowillhoit
Copy link
Contributor

🥳
Screen Shot 2022-06-30 at 10 58 47 AM

iowillhoit
iowillhoit previously approved these changes Jun 30, 2022
@mshanemc mshanemc dismissed stale reviews from iowillhoit and RodEsp via 10f75f9 June 30, 2022 17:16
@iowillhoit iowillhoit merged commit 14c0324 into v3 Jun 30, 2022
@iowillhoit iowillhoit deleted the sm/fix-isScratch branch June 30, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants