Skip to content

Commit bd67f56

Browse files
committed
Merge branch 'hotfix-17.1' into hotfix-17.2
2 parents 8a23f81 + 3ada2e5 commit bd67f56

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Rock.Blocks/WorkFlow/WorkflowEntry.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,23 @@ private InteractiveActionBag ProcessWorkflow( Model.Workflow workflow, int? acti
645645

646646
lastAction = action;
647647
lastActionTypeGuid = action.ActionTypeCache.Guid;
648+
649+
// If the LastProcessedDateTime is equal to RockDateTime.Now
650+
// then the processing of the activity will be skipped. In
651+
// general terms, this means some actions might not be processed
652+
// if the server is too fast. However, this can be difficult to
653+
// track down if the workflow type is not set to persist
654+
// automatically since one of the later actions that didn't run
655+
// might be the persist action.
656+
//
657+
// The resolution of System.DateTime.UTCNow is between .5 and 15
658+
// ms. So we need to wait until the values are no longer equal.
659+
// https://docs.microsoft.com/en-us/dotnet/api/system.datetime.utcnow?view=netframework-4.7#remarks
660+
while ( workflow.LastProcessedDateTime == RockDateTime.Now )
661+
{
662+
// TODO: In the future this should be an async Task.Delay.
663+
System.Threading.Thread.Sleep( 1 );
664+
}
648665
}
649666

650667
if ( workflow.IsPersisted )

Rock/Workflow/Action/WorkflowControl/PaymentEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ private PaymentConfiguration LoadConfiguration( WorkflowAction action, RockConte
352352
ObsidianComponent = financialGateway?.GetGatewayComponent() as IObsidianHostedGatewayComponent,
353353
EnableAch = GetAttributeValue( action, AttributeKey.EnableAch ).AsBoolean(),
354354
EnableCreditCard = GetAttributeValue( action, AttributeKey.EnableCreditCard ).AsBoolean(),
355-
EnabledSavedAccounts = authorizedPersonAlias.PersonId == requestContext.CurrentPerson?.Id,
355+
EnabledSavedAccounts = authorizedPersonAlias != null && authorizedPersonAlias.PersonId == requestContext.CurrentPerson?.Id,
356356
AuthorizedPersonAlias = authorizedPersonAlias,
357357
PaymentInformationInstructionsTemplate = GetAttributeValue( action, AttributeKey.PaymentInformationInstructions ),
358358
Amount = GetAttributeValue( action, AttributeKey.Amount, true ).AsDecimalOrNull(),

0 commit comments

Comments
 (0)