From a8f9a547893918b2a3f6a23e9bcfa99e13b28974 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Fri, 7 Aug 2020 12:12:39 -0600 Subject: [PATCH 1/2] fix: fix edge case, updated messaging --- src/connection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connection.ts b/src/connection.ts index 19341a4156..c80aa714de 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -277,11 +277,11 @@ export class Connection extends JSForceConnection { .on('record', rec => records.push(rec)) .on('error', err => reject(err)) .on('end', () => { - const totalSize = getNumber(query, 'totalSize') || maxFetch; + const totalSize = getNumber(query, 'totalSize') || 0; if (totalSize > records.length) { process.emitWarning( `The query result is missing ${totalSize - - records.length} records due to a 10,000 limit for performance reasons. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than 10,000.` + records.length} records due to a ${maxFetch} record limit for performance reasons. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than 10,000.` ); this._logger.warn( `The query: ${soql} result is missing ${totalSize - records.length} records due to an API limit.` From 7f9ab06ecbde1ac082f027f35f07002efb8dc7cf Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Fri, 7 Aug 2020 13:03:31 -0600 Subject: [PATCH 2/2] fix: updated messaging --- src/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connection.ts b/src/connection.ts index c80aa714de..4c0b36a9e6 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -281,7 +281,7 @@ export class Connection extends JSForceConnection { if (totalSize > records.length) { process.emitWarning( `The query result is missing ${totalSize - - records.length} records due to a ${maxFetch} record limit for performance reasons. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than 10,000.` + records.length} records due to a ${maxFetch} record limit. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than ${maxFetch}.` ); this._logger.warn( `The query: ${soql} result is missing ${totalSize - records.length} records due to an API limit.`