Skip to content

Bugfix For Save Failures When Using Tagging + SYNCHRONOUS_DML

Compare
Choose a tag to compare
@jongpie jongpie released this 04 Oct 17:06
· 59 commits to main since this release
a5a960f

This release fixes issue #526 reported by @cbcruz74 (in discussion #511) - previously, using a combination of Nebula Logger's tagging system + the save method SYNCHRONOUS_DML (shown in the snippet below) would fail, preventing some logging data from being saved.

Logger.info('hello').addTag('world');
Logger.saveLog(Logger.SaveMethod.SYNCHRONOUS_DML);

This was caused by code that relied on the standard field LogEntryEvent__e.EventUuid - part of the tagging system internally used this field to track & create related LogEntryTag__c records for new LogEntry__c records. When using the save method SYNCHRONOUS_DML, the EventUuid is null, which broke the LogEntryTag__c record creation.

A huge thank you to both @JMercie for working on this release (PR #539), and to @cbcruz74 for reporting the issue!

Core Unlocked Package Changes

New Field LogEntry__c.UniqueId__c

  • Added new unique external ID field LogEntry__c.UniqueId__c - this field is now used to upsert LogEntry__c records
    • This is populated with a composite key consisting of the fields LogEntryEvent__e.TransactionId__c and LogEntryEvent__e.TransactionEntryNumber__c. The combination of these fields has been implicitly a unique composite key ever since the field TransactionEntryNumber__c was introduced in v4.4.0, but it wasn't being stored anywhere - now it is, in the new UniqueId__c field
  • Added the new UniqueId__c field to the FlexiPage LogEntryRecordPage
  • Added the new UniqueId__c field to the permission sets LoggerAdmin, LoggerLogViewer, and LoggerEndUser

Bugfix For Save Failures When Using Tagging + SYNCHRONOUS_DML

  • Updated LogEntryEventHandler class to leverage the new field LogEntry__c.UniqueId__c for upserting & internally tracking LogEntry__c records and their associated LogEntryTag__c records (instead of leveraging the standard field LogEntryEvent__e.EventUuid)

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.11.6...v4.11.7