@salesforce/core 8.32.0 → 8.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -443,6 +443,10 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
443
443
  */
444
444
  update(authData) {
445
445
  if (authData && (0, ts_types_1.isPlainObject)(authData)) {
446
+ if (authData.instanceApiVersion && !(0, sfdc_1.validateApiVersion)(authData.instanceApiVersion)) {
447
+ this.logger.warn(`Ignoring invalid instanceApiVersion "${authData.instanceApiVersion}" (expected format: "XX.0")`);
448
+ authData.instanceApiVersion = undefined;
449
+ }
446
450
  this.username = authData.username ?? this.username;
447
451
  this.stateAggregator.orgs.update(this.username, authData);
448
452
  this.logger.info(`Updated auth info for username: ${this.username}`);
@@ -205,8 +205,7 @@ class Connection extends jsforce_node_1.Connection {
205
205
  if (error.name === exports.DNS_ERROR_NAME) {
206
206
  throw error; // throws on DNS connection errors
207
207
  }
208
- // Don't fail if we can't use the latest, just use the default
209
- this.logger.warn('Failed to set the latest API version:', error);
208
+ this.logger.warn(`Failed to set the latest API version (${error.name}: ${error.message}). Using default: v${this.version}`);
210
209
  }
211
210
  }
212
211
  /**
@@ -382,7 +381,10 @@ class Connection extends jsforce_node_1.Connection {
382
381
  const has24HoursPastSinceLastCheck = now.getTime() - lastChecked > kit_1.Duration.hours(24).milliseconds;
383
382
  this.logger.debug(`API version cache last checked on ${lastCheckedDateString ?? '<undefined>'} (now is ${now.toLocaleString()})`);
384
383
  if (!has24HoursPastSinceLastCheck && version) {
385
- // return cached API version
384
+ if (!(0, sfdc_1.validateApiVersion)(version)) {
385
+ this.logger.warn(`Cached instanceApiVersion "${version}" is invalid (expected format: "XX.0"). Ignoring cache and re-fetching.`);
386
+ return;
387
+ }
386
388
  this.logger.debug(`Using cached API version: ${version}`);
387
389
  return version;
388
390
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.32.0",
3
+ "version": "8.32.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",