Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions force-app/database/classes/dfflib_DatabaseTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ private with sharing class dfflib_DatabaseTest{

/**
* As per Summer'24 (API v61.0), EventBus.publish(SObject event) returns a System.UnexpectedException when attempting to publish an SObject that represents an object that isn’t a platform event.
* EventBus.publishWithAccessLevel(SObject event, AccessLevel accessLevel), introduced in Summer'26 (API v67.0), behaves the same.
* Therefore, only standard PlatformEvent or project-specific CustomEvent can be specified (though not being able to rely on)
* Hence, covering as much lines as possible and ensuring those parts of code behave as expected
*/
Expand Down Expand Up @@ -920,6 +921,7 @@ private with sharing class dfflib_DatabaseTest{

/**
* As per Summer'24 (API v61.0), EventBus.publish(SObject event) returns a System.UnexpectedException when attempting to publish an SObject that represents an object that isn’t a platform event.
* EventBus.publishWithAccessLevel(SObject event, AccessLevel accessLevel), introduced in Summer'26 (API v67.0), behaves the same.
* Therefore, only standard PlatformEvent or project-specific CustomEvent can be specified (though not being able to rely on)
* Hence, covering as much lines as possible and ensuring those parts of code behave as expected
*/
Expand Down Expand Up @@ -1419,6 +1421,7 @@ private with sharing class dfflib_DatabaseTest{

/**
* As per Summer'24 (API v61.0), EventBus.publish(SObject event) returns a System.UnexpectedException when attempting to publish an SObject that represents an object that isn’t a platform event.
* EventBus.publishWithAccessLevel(SObject event, AccessLevel accessLevel), introduced in Summer'26 (API v67.0), behaves the same.
* Therefore, only standard PlatformEvent or project-specific CustomEvent can be specified (though not being able to rely on)
* Hence, covering as much lines as possible and ensuring those parts of code behave as expected
*/
Expand Down Expand Up @@ -1923,6 +1926,7 @@ private with sharing class dfflib_DatabaseTest{

/**
* As per Summer'24 (API v61.0), EventBus.publish(SObject event) returns a System.UnexpectedException when attempting to publish an SObject that represents an object that isn’t a platform event.
* EventBus.publishWithAccessLevel(SObject event, AccessLevel accessLevel), introduced in Summer'26 (API v67.0), behaves the same.
* Therefore, only standard PlatformEvent or project-specific CustomEvent can be specified (though not being able to rely on)
* Hence, covering as much lines as possible and ensuring those parts of code behave as expected
*/
Expand Down
6 changes: 3 additions & 3 deletions force-app/database/classes/dfflib_Database_DMLProxy.cls
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public abstract class dfflib_Database_DMLProxy{
if( objList != null && !objList.isEmpty() ){
switch on action{
when dPUB_BEFORE, dPUB_AFTER_SUCCESS, dPUB_AFTER_FAILURE{
return EventBus.publish( objList );
return EventBus.publishWithAccessLevel( objList, accessLevel );
}
when dEMPTY_RECBIN{
return Database.emptyRecycleBin( objList );
Expand Down Expand Up @@ -182,7 +182,7 @@ public abstract class dfflib_Database_DMLProxy{
if( objList != null && !objList.isEmpty() && accessLevel != null ){
switch on action{
when dPUB_BEFORE, dPUB_AFTER_SUCCESS, dPUB_AFTER_FAILURE{
return EventBus.publish( objList );
return EventBus.publishWithAccessLevel( objList, accessLevel );
}
when dEMPTY_RECBIN{
return Database.emptyRecycleBin( objList );
Expand Down Expand Up @@ -287,7 +287,7 @@ public abstract class dfflib_Database_DMLProxy{
if( objList != null && !objList.isEmpty() && accessLevel != null ){
switch on action{
when dPUB_BEFORE, dPUB_AFTER_SUCCESS, dPUB_AFTER_FAILURE{
return EventBus.publish( objList );
return EventBus.publishWithAccessLevel( objList, accessLevel );
}
when dEMPTY_RECBIN{
return Database.emptyRecycleBin( objList );
Expand Down