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/w 8206747 #347

Merged
merged 13 commits into from
Jan 13, 2021
Merged

Sm/w 8206747 #347

merged 13 commits into from
Jan 13, 2021

Conversation

mshanemc
Copy link
Contributor

@W-8206747@

I hate everything about this fix. From what I can tell, the stuff leaking into the stdout isn't from us, it's from jsforce > request > asap

Screen Shot 2020-12-22 at 4 00 26 PM

Asap hasn't been updated in years and request is deprecated. This'll happen whenever jsforce.request tries to use a domain that no longer exists and gets a DNS ENOTFOUND.

You can most easily repo by creating a sandbox, authing to it, and then deleting it, and then waiting for a while for it to be destroyed.

After a few tries, the best option I could think of is to pre-check a DNS using our existing domainResolver. This required a number of updates to unit tests (where instanceUrl must exist to get past the pre-check). It was either that or a serious rewrite the tests in a major way.

src/connection.ts Outdated Show resolved Hide resolved
src/connection.ts Outdated Show resolved Hide resolved
src/connection.ts Outdated Show resolved Hide resolved
Comment on lines 126 to 130
try {
await conn.useLatestApiVersion();
} catch (e) {
conn.logger.error(`Cannot connect to the org at ${conn.options?.connectionOptions?.instanceUrl}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

useLatestApiVersion also has a try/catch and it does not rethrow, so this try/catch seems unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did some updates after Steve's feedback and a lot more e2e testing. That try/catch in useLatestApiVersion is now more error-specific for DNS problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what other scenario would prevent us from being able to determine the version, though.

src/connection.ts Outdated Show resolved Hide resolved
@mshanemc
Copy link
Contributor Author

Looking better already!

Screen Shot 2020-12-29 at 5 54 11 PM

@mshanemc mshanemc requested a review from peternhale December 29, 2020 23:55
@peternhale
Copy link
Contributor

Looking better already!

Screen Shot 2020-12-29 at 5 54 11 PM

@mshanemc, while the new error message "Org Not Found" is a great clarification, it does change the existing output. Should Claire/Juliet be consulted on this change to the output?

src/connection.ts Outdated Show resolved Hide resolved
@mshanemc mshanemc requested a review from peternhale January 4, 2021 20:07
src/connection.ts Show resolved Hide resolved
test/unit/connectionTest.ts Show resolved Hide resolved
Copy link
Contributor

@shetzel shetzel left a comment

Choose a reason for hiding this comment

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

Approve pending comment resolution

src/connection.ts Outdated Show resolved Hide resolved
@peternhale peternhale merged commit 10fc422 into develop Jan 13, 2021
@peternhale peternhale deleted the sm/W-8206747 branch January 13, 2021 21:55
@mshanemc mshanemc restored the sm/W-8206747 branch January 21, 2021 00:53
@mshanemc mshanemc deleted the sm/W-8206747 branch January 21, 2021 00:55
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.

3 participants