hunk.code_window:       type: StepTypeEnum.IN_APP,
       });
       expect(generatedMessageJob.length).to.equal(3);
  
hunk.labels: keep keep keep replace keep
hunk.after_edit:     expect(generatedMessageJob.length).to.equal(7);
  
hunk.file_path: apps/api/src/app/events/e2e/digest-events.e2e.ts
hunk.type: replace
file: import { Injectable } from '@nestjs/common';
  import { JobStatusEnum } from '@novu/dal';
  import { StepTypeEnum } from '@novu/shared';
  import { InstrumentUsecase } from '@novu/application-generic';
  
  import { DigestEventsCommand } from './digest-events.command';
  import { GetDigestEvents } from './get-digest-events.usecase';
  
  @Injectable()
  export class GetDigestEventsBackoff extends GetDigestEvents {
    @InstrumentUsecase()
    public async execute(command: DigestEventsCommand) {
      const currentJob = command.currentJob;
  
      const { digestKey, digestMeta, digestValue } = this.getJobDigest(currentJob);
  
      const jobs = await this.jobRepository.find({
        createdAt: {
          $gte: currentJob.createdAt,
        },
        _templateId: currentJob._templateId,
        status: JobStatusEnum.COMPLETED,
        type: StepTypeEnum.TRIGGER,
        _environmentId: currentJob._environmentId,
        ...(digestKey && { [`payload.${digestKey}`]: digestValue }),
        _subscriberId: command._subscriberId,
      });
  
      return this.filterJobs(currentJob, currentJob.transactionId, jobs);
    }
  }
  