Skip to content

v4.7.0 - Spring '22 Release

Compare
Choose a tag to compare
@jongpie jongpie released this 11 Mar 04:00
· 109 commits to main since this release
2b2fce1

⚠️ For orgs that are upgrading to this version: you will need to review & update your org's configurations - 2 fields on the custom hierarchy settings object LoggerSettings__c have been added - IsSavingEnabled__c and IsPlatformEventStorageEnabled__c - that will prevent logs from being saved until you update the values. When deploying new checkbox (boolean) fields, Salesforce automatically sets the value to false, even if the field's default value has true specified. You can easily update these values using the tab "Logger Settings", available via the Logger Console app - it's recommended that both fields are set to true.

New Features for LoggerSettings__c

  • Closed #258 by adding 2 new LoggerSettings__c fields to provide control over platform events & custom objects
    1. IsSavingEnabled__c - when disabled, any calls to Logger.saveLog() are ignored. This allows you to still use Logger for outputting Apex debug statements, but it completely disables saving/publishing of the platform event LogEntryEvent__e.
    2. IsPlatformEventStorageEnabled__c - this fields controls if LogEntryEvent__e platform events are transformed & stored in the custom objects Log__c and LogEntry__c (when IsSavingEnabled__c == true).
  • Closed #279 by adding some new features for "log scenarios"
    • Configure a default scenario by setting the new field LoggerSettings__c.DefaultLogScenario__c
    • Retrieve the current transaction's scenario in Apex using new method Logger.getScenario()
  • Added the ability to assign a default OwnerId for new Log__c records via a new settings field, LoggerSettings__c.DefaultLogOwner__c. This is useful for orgs that assign/manage logs for triage purposes (often done in production environments for managing logs with errors & warnings) and want more control over who is assigned as the log owner. The setting can be configured with 1 of 5 possible values
    1. Blank (null) - this will provide the same behavior that has existed in previous releases - the Log__c record will simply be assigned to the user that generated the log
    2. User ID
    3. Username
    4. Queue ID
    5. Queue DeveloperName
  • Renamed LoggerSettings__c field StripInaccessibleRecordFields__c to IsRecordFieldStrippingEnabled__c for a consistent field naming convention
  • Updated lwc loggerSettings and logEntryEventStream to support using a namespace when running in the managed package by introducing a new Apex class, LoggerSObjectMetadata. This class provides LWCs with info about SObject, SObjectField, and PicklistEntry metadata (including details about a namespace, when applicable).
  • Bumped all metadata to API v54.0 (Spring '22 release)
  • Added picklist values in Log__c.ApiVersion__c for all 3 API versions in calendar year 2022
  • Closed #15 and closed #195 by expanding wiki content. Changes for the wiki are managed in a separate repo, so this PR doesn't contain the changes, but the wiki updates have been done in parallel

image

New Features for Log__c Quick Action "Open Viewer" (formerly "View JSON")

  • Renamed the lwc logJSON back to logViewer. This change only impacts the unlocked package.
  • Renamed the quick action "View JSON" (again) to "Open Viewer"
  • Enhanced logViewer lwc to display tabs for both JSON (existing) and log file (new). The new 'log file' view displays the log's related log entries in a streamlined view that includes each entry's timestamp, logging level, message, and stack trace
  • Added a new download button to logViewer to export the selected content to a file

image

Bugfixes

  • Fixed #271 - Updated LoggerTestUtils to use the current user's profile in most cases, instead of trying to query for a particular profile. For testing behavior related to profiles without access to Logger, integration tests have been added to the extra-tests folder that still leverage the 'Standard User' profile in a scratch org, but these tests are not included in the package.
  • Fixed #272 by explicitly declaring the list as List<Schema.PicklistEntry> instead of just List<PicklistEntry>
  • Fixed #276 by updating LoggerEmailUtils to check if email deliverability is enabled in the current org prior to attempting to send any emails
  • Wrapped all dynamic query strings in String.escapeSingleQuotes() as a security best practice & to avoid PMD reporting errors for ApexSOQLInjection

Pipeline / DevOps

  • Updated pipeline to use JWT bearer flow + sfdx bot user for dev hub auth
  • Updated the Experience Cloud scratch definition to use Spanish as the language/Spain as the country as another way to monitor/test for any language-related issues in the pipeline
  • Cleaned up some PMD rule suppressions
  • Added basic Experience Cloud site to the pipeline to provide a better method of testing Experience Cloud scenarios (the site is not included in the package itself - it's only used in the pipeline). Previously, the pipeline created an Experience Cloud site via the async function sfdx force:community:create + a 2 minute delay, but the async operation is inconsistent in how long it takes to complete. By deploying the site metadata in the pipeline, it becomes a synchronous operation, which should prevent some inconsistent pipeline failures.
  • Updated/added some devDependencies in package.json to handle some dependabot alerts
  • Closed #263 by adding "ancestorVersion": "HIGHEST" in the managed package's sfdx-project.json file

New Managed Package Release

  • For orgs that are still using the managed package, this version contains all of the changes made between v4.6.0 and v4.7.0. Check out the v4.7.0 Milestone to see all of the new features & bugfixes

View v4.7.0 Milestone
View v4.7.0 Full Changelog from v4.6.0