Skip to content

Commit

Permalink
Set the body of the email to be the md5 key
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Aug 12, 2024
1 parent 0c4ecbd commit b817080
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Domains/Sources/EmailSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function handle(Source $source): void

$this->source = $this->checkForChat($source);

$key = md5($this->mailDto->date.$this->mailDto->from.$source->id);
$key = md5($this->mailDto->getContent());

if ($this->skip($this->source, $key)) {
return;
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/EmailSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function test_repeat_tasks()
'type' => SourceTypeEnum::EmailSource,
]);

LlmDriverFacade::shouldReceive('driver->completion')->never();
LlmDriverFacade::shouldReceive('driver->setToolType->chat')->never();

$body = <<<'BODY'
Quis ea esse velit id id eu consectetur deserunt exercitation exercitation. Nisi aliqua ipsum fugiat laborum aliquip nostrud eu tempor non cillum Lorem non dolor proident sunt. Irure commodo aliqua reprehenderit deserunt sint irure in excepteur quis eiusmod ullamco aliquip. Dolore tempor ea non ut.Quis ea esse velit id id eu consectetur deserunt exercitation exercitation. Nisi aliqua ipsum fugiat laborum aliquip nostrud eu tempor non cillum Lorem non dolor proident sunt. Irure commodo aliqua reprehenderit deserunt sint irure in excepteur quis eiusmod ullamco aliquip. Dolore tempor ea non ut.
Expand All @@ -213,7 +213,7 @@ public function test_repeat_tasks()

SourceTask::factory()->create([
'source_id' => $source->id,
'task_key' => md5($dto->date.$dto->from.$source->id),
'task_key' => md5($dto->getContent()),
]);

$emailSource = new \App\Domains\Sources\EmailSource();
Expand Down

0 comments on commit b817080

Please sign in to comment.