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

fix(deps): bump @jsforce/jsforce-node from 3.1.0 to 3.2.0 #1062

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"messageTransformer/messageTransformer.ts"
],
"dependencies": {
"@jsforce/jsforce-node": "^3.1.0",
"@jsforce/jsforce-node": "^3.2.0",
"@salesforce/kit": "^3.1.1",
"@salesforce/schemas": "^1.7.0",
"@salesforce/ts-types": "^2.0.9",
Expand Down
6 changes: 5 additions & 1 deletion src/util/sfdcUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export class SfdcUrl extends URL {
* @returns {boolean} true if this domain is a lightning domain
*/
public isLightningDomain(): boolean {
return this.origin.includes('.lightning.force.com') || this.origin.includes('.lightning.crmforce.mil') || this.origin.includes('.lightning.sfcrmapps.cn');
return (
this.origin.includes('.lightning.force.com') ||
this.origin.includes('.lightning.crmforce.mil') ||
this.origin.includes('.lightning.sfcrmapps.cn')
);
}
}
30 changes: 30 additions & 0 deletions test/unit/org/authInfoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ describe('AuthInfo', () => {
});

it('should return an AuthInfo instance when passed a parent username', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

Copy link
Member

Choose a reason for hiding this comment

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

if you checkout the commit before mine (0f0d32fde65f893ff9fddd1169c8de750b575d51) and run JSFORCE_LOG_LEVEL=DEBUG yarn mocha test/unit/org/authInfoTest.ts

you'll see this:

➜  sfdx-core git:(dependabot-npm_and_yarn-jsforce-jsforce-node-3.2.0) ✗ JSFORCE_LOG_L
EVEL=DEBUG yarn mocha test/unit/org/authInfoTest.ts
yarn run v1.22.19
$ /Users/cdominguez/code/gh/sf/sfdx-core/node_modules/.bin/mocha test/unit/org/authIn
foTest.ts


  AuthInfo
    create
DEBUG   [fetch]  Request failed
DEBUG   [fetch]  retrying for the 1 time
DEBUG   [fetch]  Error: FetchError: request to https://instance.84edc3d01c22bbd5da27a
e8a686e2a52.salesforce.com//services/data/v51.0/query?q=SELECT%20Id%20FROM%20ScratchO
rgInfo%20limit%201 failed, reason: getaddrinfo ENOTFOUND instance.84edc3d01c22bbd5da2
7ae8a686e2a52.salesforce.com
DEBUG   [fetch]  Request failed
DEBUG   [fetch]  retrying for the 2 time
DEBUG   [fetch]  Error: FetchError: request to https://instance.84edc3d01c22bbd5da27a
e8a686e2a52.salesforce.com//services/data/v51.0/query?q=SELECT%20Id%20FROM%20ScratchO
rgInfo%20limit%201 failed, reason: getaddrinfo ENOTFOUND instance.84edc3d01c22bbd5da2
7ae8a686e2a52.salesforce.com
DEBUG   [fetch]  Request failed
DEBUG   [fetch]  retrying for the 3 time
DEBUG   [fetch]  Error: FetchError: request to https://instance.84edc3d01c22bbd5da27a
e8a686e2a52.salesforce.com//services/data/v51.0/query?q=SELECT%20Id%20FROM%20ScratchO
rgInfo%20limit%201 failed, reason: getaddrinfo ENOTFOUND instance.84edc3d01c22bbd5da2
7ae8a686e2a52.salesforce.com

jsforce v3.1 retried these failures very fast, v3.2 delays each retry incrementally so mocha just timed out.

await $$.stubConfig({ [OrgConfigProperties.ORG_INSTANCE_URL]: testOrg.instanceUrl });
// Stub the http request (OAuth2.refreshToken())
// This will be called for both, and we want to make sure the clientSecret is the
Expand Down Expand Up @@ -462,6 +465,9 @@ describe('AuthInfo', () => {
});

it('should return a JWT AuthInfo instance when passed a username and JWT auth options despite failed DNS lookup', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

$$.setConfigStubContents('AuthInfoConfig', { contents: await testOrg.getConfig() });

const jwtConfig = {
Expand Down Expand Up @@ -531,6 +537,9 @@ describe('AuthInfo', () => {

describe('Refresh Token', () => {
it('should return a refresh token AuthInfo instance when passed a username and refresh token auth options', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const refreshTokenConfig = {
refreshToken: testOrg.refreshToken,
loginUrl: testOrg.loginUrl,
Expand Down Expand Up @@ -585,6 +594,9 @@ describe('AuthInfo', () => {
});

it('should return a refresh token AuthInfo instance with username in auth options', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const refreshTokenConfig = {
refreshToken: testOrg.refreshToken,
loginUrl: testOrg.loginUrl,
Expand Down Expand Up @@ -705,6 +717,9 @@ describe('AuthInfo', () => {
});

it('should return a refresh token AuthInfo instance with custom clientId and clientSecret', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const refreshTokenConfig = {
clientId: 'authInfoTest_clientId',
clientSecret: 'authInfoTest_clientSecret',
Expand Down Expand Up @@ -986,6 +1001,9 @@ describe('AuthInfo', () => {

describe('save', () => {
it('should update the AuthInfo fields, and write to file', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const refreshTokenConfig = {
refreshToken: testOrg.refreshToken,
loginUrl: testOrg.loginUrl,
Expand Down Expand Up @@ -1227,6 +1245,9 @@ describe('AuthInfo', () => {

describe('getSfdxAuthUrl', () => {
it('should return the correct sfdx auth url', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const authResponse = {
access_token: testOrg.accessToken,
instance_url: testOrg.instanceUrl,
Expand All @@ -1251,6 +1272,9 @@ describe('AuthInfo', () => {
});

it('should handle undefined client secret', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const authResponse = {
access_token: testOrg.accessToken,
instance_url: testOrg.instanceUrl,
Expand All @@ -1276,6 +1300,9 @@ describe('AuthInfo', () => {
});

it('should handle undefined refresh token', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const authResponse = {
access_token: testOrg.accessToken,
instance_url: testOrg.instanceUrl,
Expand All @@ -1300,6 +1327,9 @@ describe('AuthInfo', () => {
});

it('should handle undefined instance url', async () => {
stubMethod($$.SANDBOX, AuthInfo.prototype, 'determineIfDevHub').resolves(false);
stubMethod($$.SANDBOX, AuthInfo.prototype, 'getNamespacePrefix').resolves();

const authResponse = {
access_token: testOrg.accessToken,
instance_url: testOrg.instanceUrl,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@jsforce/jsforce-node@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.1.0.tgz#7f1b4ba60c0c84b870af8e43d713907b10ed8152"
integrity sha512-xsn6Qj36YyhG7uCL9DOswZhqN/OVIpXm5s8AWD7V9hSJfp5ReebEsjT7a52ztEMmkUAYjWvZC5alBJr7jJCJig==
"@jsforce/jsforce-node@^3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.2.0.tgz#4b104613fc9bb74e0e38d2c00936ea2b228ba73a"
integrity sha512-3GjWNgWs0HFajVhIhwvBPb0B45o500wTBNEBYxy8XjeeRra+qw8A9xUrfVU7TAGev8kXuKhjJwaTiSzThpEnew==
dependencies:
"@sindresorhus/is" "^4"
"@types/node" "^18.15.3"
Expand Down
Loading