Skip to content
Home » Bear Trap Alerts

Bear Trap Alerts

There are issues that just are not obvious at the first look. You might be pulling your hair out for hours. Misleading documentation (or just lack of it) can be one of the ways to end up at these situations. Another is just not paying enough attention. Whatever the reason, these things happen and often make interesting stories. Here I share some of the ‘Gotchas’ I ran into myself.

LWC Component Bundle in purgatory

LWC in Purgatory

Jun 12, 202402 min

You cannot easily move LWC Component Bundles which call Apex between Unlocked Packages with Namespace

Bear confused by a lcok

Accidental Permissions

Apr 26, 202402 min

Installing or upgrading a package via Salesforce CLI will add permissions to profile of installing user even if they are not Administrator.

Hand reading through from outside to grab a box

UoW and SObject Instances

Oct 28, 202314 min

Remember that SObjects passed as arguments in Apex point to the same instance, even into the UoW. If you change your variable after registering it as dirty you may affect what gets committed in the end.

Picture illustrating waste

Wasting Time in Disabled fflib Trigger Handlers

Jun 27, 202304 min

Did you know that you can dynamically disable fflib_SObjectDomain Trigger Handlers? You did? Ok then, did you know that when you do disable them their constructors run anyway? So be careful not to put any (expensive) logic inside those.

Puzzle with a missing piece

UoW’s Dirty Little Secret

Mar 15, 202324 min

Did you know that you have to be super careful with registering records as dirty with a Unit of Work? If you happen to register the same record a second time you can lose your original registered updates. This is especially likely when you are trying to use the UOW…

picture of person with 2 different shoes

Queueable Running User in Unit Test

Mar 15, 202304 min

Running User of a Queueable job in Unit Test depends on who executes Test.stopTest() and not System.enqueueJob()