Skip to content

Commit

Permalink
v1.5.73 - Limit Amount bugfix (#458)
Browse files Browse the repository at this point in the history
* Fixes an issue reported in #457 where using a Limit Amount in conjunction with first/last can throw an error if the number of children exceeds the limit amount
  • Loading branch information
jamessimone authored Jun 26, 2023
1 parent e06b086 commit e69fcb4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co

## Deployment & Setup

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008So6QAAS">
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008So7xAAC">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008So6QAAS">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008So7xAAC">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
Expand Down
1 change: 1 addition & 0 deletions extra-tests/classes/InvocableDrivenTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ private class InvocableDrivenTests {

@IsTest
static void shouldClearParentFieldOnDelete() {
// driven by extra-tests/flows/Rollup_Integration_refresh_on_delete_clears_value.flow-meta.xml
RollupParent__c parent = new RollupParent__c(NumberField__c = 1, Name = 'Parent');
insert parent;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
"version": "1.5.72",
"version": "1.5.73",
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion rollup-namespaced/sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"default": true,
"package": "apex-rollup-namespaced",
"path": "rollup-namespaced/source/rollup",
"versionName": "Test coverage for DELETE-based flows resetting values",
"versionName": "Fixes an issue reported in #457 where using a Limit Amount in conjunction with first/last can throw an error if the number of children exceeds the limit amount",
"versionNumber": "1.0.45.0",
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
Expand Down
2 changes: 1 addition & 1 deletion rollup/core/classes/RollupCalculator.cls
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public without sharing abstract class RollupCalculator {
if (this.metadata?.LimitAmount__c != null) {
// we can only safely remove the items after sorting
while (temporaryItems.size() > this.metadata.LimitAmount__c && temporaryItems.isEmpty() == false) {
temporaryItems.remove(items.size() - 1);
temporaryItems.remove(temporaryItems.size() - 1);
}
// Limit-based rollups always reset the field's value, and always act as a fresh start
if (this.metadata.RollupOperation__c.contains('DELETE_') || this.metadata.RollupOperation__c.contains('UPDATE_')) {
Expand Down
2 changes: 1 addition & 1 deletion rollup/core/classes/RollupLogger.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global without sharing virtual class RollupLogger implements ILogger {
@TestVisible
// this gets updated via the pipeline as the version number gets incremented
private static final String CURRENT_VERSION_NUMBER = 'v1.5.72';
private static final String CURRENT_VERSION_NUMBER = 'v1.5.73';
private static final LoggingLevel FALLBACK_LOGGING_LEVEL = LoggingLevel.DEBUG;
private static final RollupPlugin PLUGIN = new RollupPlugin();

Expand Down
7 changes: 4 additions & 3 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"default": true,
"package": "apex-rollup",
"path": "rollup",
"versionName": "Test coverage for DELETE-based flows resetting values",
"versionNumber": "1.5.72.0",
"versionName": "Fixes an issue reported in #457 where using a Limit Amount in conjunction with first/last can throw an error if the number of children exceeds the limit amount",
"versionNumber": "1.5.73.0",
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
"unpackagedMetadata": {
Expand Down Expand Up @@ -105,6 +105,7 @@
"apex-rollup@1.5.69-0": "04t6g000008SnlnAAC",
"apex-rollup@1.5.70-0": "04t6g000008SnrXAAS",
"apex-rollup@1.5.71-0": "04t6g000008So61AAC",
"apex-rollup@1.5.72-0": "04t6g000008So6QAAS"
"apex-rollup@1.5.72-0": "04t6g000008So6QAAS",
"apex-rollup@1.5.73-0": "04t6g000008So7xAAC"
}
}

0 comments on commit e69fcb4

Please sign in to comment.