message: Prevent deli from sending summary throttling nacks mid batch
diff: @@ -418,22 +418,6 @@ export class DeliLambda extends TypedEventEmitter<IDeliLambdaEvents> implements
  continue;
  }
  - // Check if Deli is over the max ops since last summary nack limit
  - if (this.serviceConfiguration.deli.summaryNackMessages.enable &&
  - !this.nackMessages.has(NackMessagesType.SummaryMaxOps)) {
  - const opsSinceLastSummary = this.sequenceNumber - this.durableSequenceNumber;
  - if (opsSinceLastSummary > this.serviceConfiguration.deli.summaryNackMessages.maxOps) {
  - // this op brings us over the limit
  - // start nacking non-system ops and ops that are submitted by non-summarizers
  - this.updateNackMessages(NackMessagesType.SummaryMaxOps, {
  - identifier: NackMessagesType.SummaryMaxOps,
  - content: this.serviceConfiguration.deli.summaryNackMessages.nackContent,
  - allowSystemMessages: true,
  - allowedScopes: [ScopeType.SummaryWrite],
  - });
  - }
  - }
  -
  const sequencedMessage = ticketedMessage.message;
  if (this.serviceConfiguration.deli.enableOpHashing) {
  @@ -520,8 +504,26 @@ export class DeliLambda extends TypedEventEmitter<IDeliLambdaEvents> implements
  this.clearActivityIdleTimer();
  this.setActivityIdleTimer();
  + if (sequencedMessageCount > 0) {
  + // Check if Deli is over the max ops since last summary nack limit
  + // Note: we are explicitly checking this after processing the entire boxcar in order to not break batches
  + if (this.serviceConfiguration.deli.summaryNackMessages.enable &&
  + !this.nackMessages.has(NackMessagesType.SummaryMaxOps)) {
  + const opsSinceLastSummary = this.sequenceNumber - this.durableSequenceNumber;
  + if (opsSinceLastSummary > this.serviceConfiguration.deli.summaryNackMessages.maxOps) {
  + // this op brings us over the limit
  + // start nacking non-system ops and ops that are submitted by non-summarizers
  + this.updateNackMessages(NackMessagesType.SummaryMaxOps, {
  + identifier: NackMessagesType.SummaryMaxOps,
  + content: this.serviceConfiguration.deli.summaryNackMessages.nackContent,
  + allowSystemMessages: true,
  + allowedScopes: [ScopeType.SummaryWrite],
  + });
  + }
  + }
  +
  // Update the op event idle & max ops counter if ops were just sequenced
  - if (this.serviceConfiguration.deli.opEvent.enable && sequencedMessageCount > 0) {
  + if (this.serviceConfiguration.deli.opEvent.enable) {
  this.updateOpIdleTimer();
  const maxOps = this.serviceConfiguration.deli.opEvent.maxOps;
  @@ -534,6 +536,7 @@ export class DeliLambda extends TypedEventEmitter<IDeliLambdaEvents> implements
  }
  }
  }
  + }
  public close(closeType: LambdaCloseType) {
  this.closed = true;
  