|
6379
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6379
|
|
6380
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6380
|
|
6381
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6381
|
|
6382
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6382
|
|
6383
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6383
|
|
6384
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6384
|
|
6385
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6385
|
|
6386
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6386
|
|
6387
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6387
|
|
6388
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6388
|
|
6389
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6389
|
|
6390
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6390
|
|
6391
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6391
|
|
6392
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6392
|
|
6393
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6393
|
|
6394
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6394
|
|
6395
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6395
|
|
6396
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6396
|
|
6397
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6397
|
|
6398
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6398
|
|
6399
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6399
|
|
6400
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6400
|
|
6401
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6401
|
|
6402
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6402
|
|
6403
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6403
|
|
6404
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6404
|
|
6405
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6405
|
|
6406
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6406
|
|
6407
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6407
|
|
6408
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6408
|
|
6409
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6409
|
|
6410
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6410
|
|
6411
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6411
|
|
6412
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6412
|
|
6413
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6413
|
|
6414
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Jiminny\Enums\CrmObject;
use Jiminny\Events\Crm\DetachActivityObject;
use Jiminny\Models\Activity;
use Psr\Log\LoggerInterface;
use Throwable;
trait DeleteCrmEntityTrait
{
public int $tries = 3;
public function timeout(): int
{
return 300; // 5 minutes
}
public function backoff(): array
{
return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes
}
protected function handleActivities(
Collection $activities,
Dispatcher $dispatcher,
LoggerInterface $logger,
bool $emitEvent = true,
): void {
if ($activities->isEmpty()) {
return;
}
$crmObject = $this->getEntityType();
$entityIdField = $crmObject->value . '_id';
$activities->each(
function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {
$stageId = $activity->getStage()?->getId();
$logData = [
$crmObject->value => $this->id,
'activity' => $activity->getId(),
'emitEvent' => $emitEvent,
];
$updateData = [
$entityIdField => null,
];
// For leads and opportunities, also nullify the stage_id
if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {
$updateData['stage_id'] = null;
$logData['stage_id'] = $stageId;
}
$activity->update($updateData);
if ($emitEvent) {
$dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));
}
$logger->info($this->getLogPrefix() . ' Detach from activity', $logData);
// Dispatch job to verify if CRM task/event still exists
if ($activity->hasCrmProviderId()) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
}
);
}
public function failed(Throwable $exception): void
{
$crmObject = $this->getEntityType();
Log::critical($this->getLogPrefix() . ' Job failed permanently', [
$crmObject->value => $this->id,
'exception' => $exception->getMessage(),
]);
}
// Abstract methods that must be implemented by the using class
abstract protected function getLogPrefix(): string;
abstract protected function getEntityType(): CrmObject;
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
NULL
|
6414
|
|
6415
|
Last login: Thu May 7 09:45:09 on ttys010
Poetry Last login: Thu May 7 09:45:09 on ttys010
Poetry could not find a pyproject.toml file in /Users/lukas or its parents
Poetry could not find a pyproject.toml file in /Users/lukas or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll
total 667416
drwxr-xr-x 11 lukas staff 352 7 May 13:40 .
drwx------+ 93 lukas staff 2976 7 May 13:40 ..
drwxr-xr-x 18 lukas staff 576 6 May 20:31 data
-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite
-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm
-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal
drwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes
-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log
-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log
-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh
-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe
449M /Users/lukas/.screenpipe
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $
DOCKER
Close Tab
DEV (-zsh)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
-zsh
Close Tab
⌥⌘1
-zsh...
|
iTerm2
|
-zsh
|
NULL
|
6415
|
|
6416
|
Last login: Thu May 7 09:45:09 on ttys010
Poetry Last login: Thu May 7 09:45:09 on ttys010
Poetry could not find a pyproject.toml file in /Users/lukas or its parents
Poetry could not find a pyproject.toml file in /Users/lukas or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll
total 667416
drwxr-xr-x 11 lukas staff 352 7 May 13:40 .
drwx------+ 93 lukas staff 2976 7 May 13:40 ..
drwxr-xr-x 18 lukas staff 576 6 May 20:31 data
-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite
-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm
-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal
drwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes
-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log
-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log
-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh
-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe
449M /Users/lukas/.screenpipe
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $
DOCKER
Close Tab
DEV (-zsh)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
-zsh
Close Tab
⌥⌘1
-zsh...
|
iTerm2
|
-zsh
|
NULL
|
6416
|
|
6417
|
2026-05-07T18:54:06.694530Z INFO screenpipe_engin 2026-05-07T18:54:06.694530Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)
2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)
2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames
2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted
2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted
2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames
2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted
2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted
2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
tip: sign in for higher AI quotas + cloud sync:
screenpipe login
2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames
2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted
2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted
2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
tip: get the screenpipe desktop app for the full experience
https://screenpi.pe
2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)
2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)
2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)
2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames
2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted
2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames
2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted
2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping captur...
|
iTerm2
|
screenpipe"
|
NULL
|
6417
|
|
6418
|
2026-05-07T18:54:10.198532Z INFO screenpipe_engin 2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)
2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)
2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)
2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames
2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted
2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted
2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames
2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted
2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted
2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
tip: sign in for higher AI quotas + cloud sync:
screenpipe login
2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames
2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted
2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted
2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
tip: get the screenpipe desktop app for the full experience
https://screenpi.pe
2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)
2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)
2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)
2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames
2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted
2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames
2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted
2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: f...
|
iTerm2
|
screenpipe"
|
NULL
|
6418
|
|
6419
|
2026-05-07T18:54:55.497046Z INFO screenpipe_engin 2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)
2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)
2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)
2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)
2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)
2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)
2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)
2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)
2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)
2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)
2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)
2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames
2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted
2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted
2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)
2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)
2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)
2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)
2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames
2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted
2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted
2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
tip: sign in for higher AI quotas + cloud sync:
screenpipe login
2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)
2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)
2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)
2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames
2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted
2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted
2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
tip: get the screenpipe desktop app for the full experience
https://screenpi.pe
2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)
2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)
2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)
2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)
2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)
2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)
2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames
2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted
2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted
tip: wire screenpipe into claude with one command:
claude mcp add screenpipe -- npx -y screenpipe-mcp
then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity
2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames
2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted
2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted
tip: install a starter bundle of pipes:
screenpipe install https://screenpi.pe/start.json
2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)
2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)
2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 27 eligible frames
2026-05-07T19:23:59.596007Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.1x), 11 JPEGs deleted
2026-05-07T19:24:00.891142Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 1.1MB (2.5x), 14 JPEGs deleted
2026-05-07T19:24:36.746388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:24:42.261437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)
2026-05-07T19:25:14.335824Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:14.501546Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:18.608719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)
2026-05-07T19:25:21.337705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:21.444990Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
tip: sign in for higher AI quotas + cloud sync:
screenpipe login
2026-05-07T19:25:24.322060Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:24.497521Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:29.631670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)
2026-05-07T19:25:29.804593Z INFO screenpipe_engine::event_driven_capture: content de...
|
iTerm2
|
screenpipe"
|
NULL
|
6419
|
|
6424
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp> 0• Daily - Platform • in 19 m100%8Fri 8 May 9:26:18screenpipe"181DOCKERDEV (-zsh)882APP (-zsh)83-zsh• 84screenpipe"-zsh₴6youareusinglocalprocessing. all your data stays on your computer.warning: telemetry is enabled. onlyerror-level data will be sent.todisable, usethe --disable-telemetry flag.check latestchanges here:https://github.com/screenpipe/screenpipe/releases2026-05-08T09:25:45.881961ZINFOscreenpipe:starting UIevent capture2026-05-08T09:25:45.888762ZINFOscreenpipe_engine::power::manager:initialpower profile: Performance Con_ac=true, battery=Some(100))2026-05-08T09:25:45.891286ZWARNscreenpipe:piagent install failed: bun not found - install from https://bun.sh2026-05-08709:25:45.8965832INFOscreenpipe_engine::ui_recorder: Starting Ul event capture2026-05-08T09:25:45.913159ZINFOscreenpipe_engine::ui_recorder: UIrecording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca22026-05-08T09:25:45.913483ZINFOscreenpipe_engine::calendar_speaker_id: speakeridentification: started (user_name=<not set>)2026-05-08709:25:45.9135122INFOscreenpipe_engine: :hot_frame_cache: hot_frame_cache: warmingfrom DB (2026-05-0706:25:45.913511 UTC to2026-05-0806:25:45.913511 UTO2026-05-08T09:25:45.914574ZINFOscreenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)2026-05-08T09:25:45.923208ZINFOscreenpipe_engine::server: Server listening on [IP_ADDRESS]:30302026-05-08T09:25:45.927056ZINFOscreenpipe_connect: :mdns: mdns: advertising screenpipe on port 30302026-05-08T09:25:46.310992ZINFO2026-05-08T09:25:46.311039ZINFOscreenpipe_engine::vision_manager::manager:Starting vision recordingfor monitor 1 (1440x900)screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)2026-05-08T09:25:46.311076ZINFOscreenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)2026-05-08T09:25:46.472936ZINFOscreenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)2026-05-08709:25:46.472968ZINFO2026-05-08T09:25:46.472981Zscreenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)INFOscreenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)2026-05-08T09:25:46.472989ZINFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)2026-05-08T09:25:46.473017ZINFOscreenpipe_engine::event_driven_capture:event-driven capturestartedfor monitor2 (device: monitor_2)2026-05-08T09:25:47.579143ZINFO sck_rs::stream_manager:2026-05-08T09:25:47.807876Zpersistent SCK stream started for display 1 (1440x900,2fps, 2 excluded)INFO sck_rs::stream_manager: persistent SCK stream started fordisplay 2 (3008x1253,2fps, 2 excluded)2026-05-08T09:25:49.233996ZWARN sqlx::query:summary="SELECT f.id,f.timestamp, f.offset_index,_" db.statement="\n\nSELECT\n f.id,\nf.timestamp,\n f.offset_index,\n COALESCE(\nSUBSTR(f.full_text, 1, 200), \nSUBSTR(f.accessibility_text,1,200), \n(\nSELECT\nSUBSTR(ot.text, 1, 200)\nFROM\nocr_text ot\nWHERE\not.frame_id = f.id\nLIMIT \n1\n>\nas text,\nCOALESCE\nf.app_name, \n\nSELECTAnot.app_name\nFROM\nocr_text ot\nWHERE\not.frame_id =f.id\nLIMIT\n1\n)\n) as app_name, \nCOALESCE(\nM\nocr_text ot\nWHERE\not.frame_id =f.id\n)\n) as window_name, \nCOALESCE(vc.device_name,f.device_name) asscreen_device, \nCOALESCE(vc.file_path,f.snapshot_path) as video_path, \nLIMIT\n1\nf.window_name, \n(\nSELECT\not.window_name\nFROCOALESCE(vc.fps, 0.033) as chunk_fps, \nN f.video_chunk_id = vc.id\nWHERE\nf.timestamp >= ?1\nf.browser_url,\nf.machine_id\nFROMnframes f\n LEFT JOIN video_chunks vc 0AND f.timestamp <= ?2\n AND COALESCE(vc.file_path, f.snapshot_path, "') NOT LIKE 'cloud://%'\nORDER BY\nf.timestamp DESC, \nf.offset_index DESC\nLIMIT\n 10000\n*rows_affected=0 rows_returned=6262 elapsed=3.319831958s2026-05-08T09:25:49.259779Z2026-05-08T09:25:49.287128ZINFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warmed with 6262 frame entries, coverage from 2026-05-07 06:25:45.913511 UTCWARN sqlx:: query:summary="PRAGMA wal_checkpoint(TRUNCATE)"2026-05-08T09:25:49.298656ZWARNsalx::query:summary="BEGIN IMMEDIATE"db.statement="*db.statement=""rows_affected=1 rows_returned=1elapsed=3.372462875srows_affected=0 rows_returned=02026-05-08T09:25:49.308025Zelapsed=2.291237167sINFOscreenpipe_engine::event_driven_capture: startup capture for monitor 1: frame_id=6417, dur=1635ms2026-05-08T09:25:49.316412Z2026-05-08T09:25:53.067387ZINFO screenpipe_engine::event_driven_capture: startup capture for monitor 2: frame_id=6418, dur=1452msINFO2026-05-08709:26:03.550801Zscreenpipe_engine::event_driven_capture:content dedup: skipping capture for monitor 1 (hash=-1292138115173956966, trigger=visual_change)WARN screenpipe_ally::tree::macos_lines:lines: AXUIElementCopyParameterizedAttributeValue(AXLineForIndex) failed status=os::Status { raw: -25212, fcc....", help: "https://www.osstatus.com?search=-25212" } - first failure (further failures suppressed); search highlights will fall back to paragraph bbox on this app...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
NULL
|
6424
|
|
6425
|
PhostormCoderravsco.sProledey© CrmActivityService. PhostormCoderravsco.sProledey© CrmActivityService.php=custom.logElaravel.log# SF [jiminny@localhost]4 HS_local [jiminny@localhost](C) CreateAvailabilitvN© CheckAndRetryRemoteMatch.phptiò accounts jiminny@localhost]# console [Pkol)# console [eu)A console [STAGING]wwiiteenineln→© CreateCommentNo~/minny/app/app/so0s/crm/matcnacuvtycmmbata.ongT OpportunitysyncIrait.pnpclarelscrict-cypes=l)wwoewaeaunlelalntento uredlemessageure© CreateNotifyContril(C)MatchCrmData.phoc) createkequestnou© CreateShareNotific:> @ Conferencesmespace Jiminny Component Utility Service:(C) PayloadBuilder.oho© Activity.php© DefaultUpdateCrmDataResolver.phrCachedCrmServiceDecorator.php© Pipedrive/Service.php© Servicelnterface.phpreadonly class RematchActivity0nCrm0bjectDetach implements ShouldQueuepublic function handle(DetachActivity0bject Sevent): voide..m X4 A Vass ProviderRateL1m1ten_connections•J emDFollowingProvidersD Sessionsv Sms> C Intercomv Planhai© CreateSmsRecei 49© CreateSmsSentt 50C. SmsListener.ohoSoftphone© DialerMetricsimported. s© ElasticSearchMetricsR s5© GenerateExportToken: 5.© ImportRemoteTrackLis 57© PlanhatActivityListenel6 ReindexForAccountLis 596 ReindexForContactList 60C kelndexrorGroupListel A1@ ReindexForLeadListeneelalalewalllleeteec kesolverrovider.ono(C) SendExportEmall.php© SetupintegrationActior 67© UserPilotActivityListen0 AuthenticationAutomatedReportsa calendars1a ermBootstrapintegrationAl 73© ImportActivityTypes.pl 74C) ImoortMetadata.oho©InitProfiles.php© LayoutModifiedListene 72© LayoutUpdatedListene 78RematchActivityOnCrn 79(C) Recolve@wner nhnif (! in_array($crmObject,naystack. selt::surrukicu ubJells.strict crue)Sthis->logger->debug('[RematchActivity0nCrm0biectDetachl Skipping rematch for CRM obiect type'. ['acuviry = sacrivicy->qerloor'crm obnect' => Scrmobnect->value.return:if Sactivitv->istvoeConference&c!in_array($activity->getStatus(),havstack: Activity. SINTTE STATES CONFERENCE.strict: true)Sthis->logger-›info('[RematchActivity0nCrm0bjectDetach] Skipping rematch for non-finite conference activity','activity' => $activity-›getId(),'crm_object' => $crm0bject->value,Sthis->Logger->info('[RematchActivity0nCrm0bjectDetach] Try to match new crm data for deleted object', ['activity' => $activity->getId(),'crm_object' => $crm0bject->value,Bus::chaindlnew MatchActiv1tycrmbatadactivitvid: sactivity-›getido.remoteSearch: false.new CheckAndRetrvRemoteMatcheactivitvid: Sactivitv->aetidolcrmObiect: ScrmObiect.D->dicnatcho•public function __construct(RateLimiter SrateLimiter)t...}oublic function canMakeReguestPateLimited Sorovider): bool** Ovan Ratel imitintenface Sratol imit */foreach ($provider->getRateLimits() as SrateLimit) {if (Sthis->rateLimiter->tooManyAttempts($key, $rateLimit->getQuotaO)) {recurn true.pubLic tunction requestava1lableln RateLimited Sprovider: 1ntreturn Sprovider->qetrateL1m1tso->1sNotzmptyoSprovider->qetRateLimits@)->man(fn (RateLimitInterface SrateLimit): int => Sthis>max@nuhiaic Function incrementRequestcountRateimited Sarovider): void/** @var RateLimitInterface $rateLimit */forpach(Snroviden->aetRatelimitcoas Snatelimit)&Sthis->natel imitenit(Sratel imit->aetkevoi. Cnatel imit->aetWindowon•-›avanlableincratelimtDally - Platorm• In 15m100% 2Fri 8 May 9:26:17CascadeHubspot Rate LimitingHubSpot Rate Limit HPart 1: Why 1300 Activities → 2600 Jobs (Step-by-Step)Step 1: One Delete Job Loops Through ActivitiesDeleteCrmEntityTrait.php:43-76O phpSactivities-seach(function (Activity Sactivity) use (...) ‹// For 1300 activities, this runs 1300 timesSactivity->update( l'account_id'Sdispatcher->dispatch(new DetachActivity0bject(Sactivity, $crmobject)); // - 1300 eventsResult after Step 1: 1300 DetachActivity0bject events fired (one per activity).Step 2: Listener Reacts to Each EventRematchAct1v1ty0nCrm0b1ectDetach.php:76-86i ohonew MeckActivtyRcmetatch(atdtyd ren teseaicht false), / 30b Bnew Cheскаnокeсrукemoremacchactivicyld:... crmObiect. ...,1→disoatcho:For each of the 1300 events, the listener dispatches a chain of 2 jobs.• 1300 x 'atchactivitvermbata (ocal search. remoteSearch=talse ))• 1300 x CheckAndRetryRemoteMatchStep 3: CheckAndRetryRemoteMatch May Dispatch AnotherCheckAndRetrvRemoteMatch.php: 46-86if (ShasMatch)recurn;// No new job if local match succeededI Otherwice disnatch remote cearchiSdispatcher->dispatch(new MatchActivityCrmData(activityId: .... remoteSearch: true)):+0 ..If local search fails (most common after a delete), this dispatches a third MatchActivityCrmData (with remoteSearch=true)Step 4: Final.Job CountsJob TypeMatchActivityCrmData (local)CountHits HubSoot Search Apl?1300X No (DB only)No (DB onlvYou've used 98% of your quota. Quota resets May 8, 11:00 AM GMT+3.8 files +82* Reiect allAccent alliAsk anvthina (*4L)Claude Onus 4.7 MediumW Windsurf Teams 71:31 UTF-8f 4 spaces...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
NULL
|
6425
|
|
6436
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp> 0• Daily - Platform • in 19 m100%8Fri 8 May 9:26:45screenpipe"181DOCKERDEV (-zsh)882APP (-zsh)83-zsh• 84|screenpipe"-zsh₴6youareusinglocalprocessing. all your data stays on your computer.warning: telemetry is enabled. onlyerror-level data will be sent.todisable, usethe --disable-telemetry flag.check latestchanges here:https://github.com/screenpipe/screenpipe/releases2026-05-08T09:25:45.881961ZINFOscreenpipe:starting UIevent capture2026-05-08T09:25:45.888762ZINFOscreenpipe_engine::power::manager:initialpower profile: Performance Con_ac=true, battery=Some(100))2026-05-08T09:25:45.891286ZWARNscreenpipe:piagent install failed: bun not found - install from https://bun.sh2026-05-08709:25:45.8965832INFOscreenpipe_engine::ui_recorder: Starting Ul event capture2026-05-08T09:25:45.913159ZINFOscreenpipe_engine::ui_recorder: UIrecording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca22026-05-08T09:25:45.913483ZINFOscreenpipe_engine::calendar_speaker_id: speakeridentification: started (user_name=<not set>)2026-05-08709:25:45.9135122INFOscreenpipe_engine: :hot_frame_cache: hot_frame_cache: warmingfrom DB (2026-05-0706:25:45.913511 UTC to2026-05-0806:25:45.913511 UTO2026-05-08T09:25:45.914574ZINFOscreenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)2026-05-08T09:25:45.923208ZINFOscreenpipe_engine::server: Server listening on [IP_ADDRESS]:30302026-05-08T09:25:45.927056ZINFOscreenpipe_connect: :mdns: mdns: advertising screenpipe on port 30302026-05-08T09:25:46.310992ZINFO2026-05-08T09:25:46.311039ZINFOscreenpipe_engine::vision_manager::manager:Starting vision recordingfor monitor 1 (1440x900)screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)2026-05-08T09:25:46.311076ZINFOscreenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)2026-05-08T09:25:46.472936ZINFOscreenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)2026-05-08709:25:46.472968ZINFO2026-05-08T09:25:46.472981Zscreenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)INFOscreenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)2026-05-08T09:25:46.472989ZINFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)2026-05-08T09:25:46.473017ZINFOscreenpipe_engine::event_driven_capture:event-driven capturestartedfor monitor2 (device: monitor_2)2026-05-08T09:25:47.579143ZINFO sck_rs::stream_manager:2026-05-08T09:25:47.807876Zpersistent SCK stream started for display 1 (1440x900,2fps, 2 excluded)INFO sck_rs::stream_manager: persistent SCK stream started fordisplay 2 (3008x1253,2fps, 2 excluded)2026-05-08T09:25:49.233996ZWARN sqlx::query:summary="SELECT f.id,f.timestamp, f.offset_index,_" db.statement="\n\nSELECT\n f.id,\nf.timestamp,\n f.offset_index,\n COALESCE(\nSUBSTR(f.full_text, 1, 200), \nSUBSTR(f.accessibility_text,1,200), \n(\nSELECT\nSUBSTR(ot.text, 1, 200)\nFROM\nocr_text ot\nWHERE\not.frame_id = f.id\nLIMIT \n1\n>\nas text,\nCOALESCE\nf.app_name, \n\nSELECTAnot.app_name\nFROM\nocr_text ot\nWHERE\not.frame_id =f.id\nLIMIT\n1\n)\n) as app_name, \nCOALESCE(\nLIMIT\n1\nf.window_name, \n(\nSELECT\not.window_name\nFROM\nocr_text ot\nWHERE\not.frame_id =f.id\n)\n) as window_name, \nCOALESCE(vc.device_name,f.device_name) asscreen_device, \nCOALESCE(vc.file_path,f.snapshot_path) as video_path,\nCOALESCE(vc.fps, 0.033) as chunk_fps, \nN f.video_chunk_id = vc.id\nWHERE\nf.timestamp >= ?1\nf.browser_url,\nf.machine_id\nFROMnframes f\n LEFT JOIN video_chunks vc 0AND f.timestamp <= ?2\n AND COALESCE(vc.file_path, f.snapshot_path, "') NOT LIKE 'cloud://%'\nORDER BY\nf.timestamp DESC, \nf.offset_index DESC\nLIMIT\n 10000\n*rows_affected=0 rows_returned=6262 elapsed=3.319831958s2026-05-08T09:25:49.259779Z2026-05-08T09:25:49.287128ZINFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warmed with 6262 frame entries, coverage from 2026-05-07 06:25:45.913511 UTCWARN sqlx:: query:summary="PRAGMA wal_checkpoint(TRUNCATE)"2026-05-08T09:25:49.298656ZWARNsalx::query:summary="BEGIN IMMEDIATE"db.statement="*db.statement=""rows_affected=1 rows_returned=1elapsed=3.372462875srows_affected=0 rows_returned=02026-05-08T09:25:49.308025Zelapsed=2.291237167sINFOscreenpipe_engine::event_driven_capture: startup capture for monitor 1: frame_id=6417, dur=1635ms2026-05-08T09:25:49.316412Z2026-05-08T09:25:53.067387ZINFO screenpipe_engine::event_driven_capture: startup capture for monitor 2: frame_id=6418, dur=1452msINFO2026-05-08709:26:03.550801Zscreenpipe_engine::event_driven_capture:content dedup: skipping capture for monitor 1 (hash=-1292138115173956966, trigger=visual_change)WARN screenpipe_ally::tree::macos_lines:lines: AXUIElementCopyParameterizedAttributeValue(AXLineForIndex) failed status=os::Status { raw: -25212, fcc....", help: "https://www.osstatus.com?search=-25212" } - first failure (further failures suppressed); search highlights will fall back to paragraph bbox on this app...
|
iTerm2
|
NULL
|
NULL
|
6436
|
|
6437
|
PhostormProledeyg createnotes.ongС MаLсhACuViLies PhostormProledeyg createnotes.ongС MаLсhACuViLies lONeWс маchаcиvilycrmbatae Noteoblect.onp© saveAcuivity.ongcsavelranscriouion.onc© SetupLayout.phpc) SyncActivitv.php© SyncFieldMetadata.phc) SyncHubspotObiects.r© SyncLeads.phpc) SvncObiects.ohg© SvncOpportunities.lobc) suncoooortunitv.ono(C) SvncProfileMetadata.clC) SvncTeam=ields.Job.oll© SyncTeamMetadata.pl© UpdateOpportunitySpC) UodateStage.ongM noalRicksD MailboxN MeetinaRotlM Middleware(C) HandleHubsnotPatel ir(c) RateLimited.onoD StreamingD Teamleleononyv C Userc) ChangeEmallJob.php© DeactivateUserJob.ph 105© DeleteScheduledUser/ 106(C) SetupDeraultsavedSe: 107SyncTolntercom.phpc) sunc lop anhat.onoC) SuncToUserPilot.ohoC BaseProcessina.Job.oho(C) ImoortRecallA Recordinas 1131(C) ImoortRemoteTrack Job,o 114C.lob.nhn© .JobDispatcher.php(n.lobDisnatcherlnterface.nl 117@ PuraeSoftDeletedOnnorti 119)#. SasVicibilitvControl.nhnlv D Listenersv D ActivitiesvM ActivityDrovidor3m luctenliv D UserPilot(e) TrackDrovidorint 106code(©) CrmActivityService.phg© CheckAndRetryRemoteMatch.php© HubsT OpportunitySyncTrait.phpC) MatchCrmData.pho(C) PayloadBuilder.ohoC) Activity.php(C) DetaultUpdateCrmDataResolver.ohgC) CachedCrmServiceDecorator.php© Pipedrive/Service.phpclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUniqueoublic function handledconectson peo,): void 1Sactivity = SactivityRepository->findByld(Sthis->activityld):if (Sactivity === null) 1throw new InvalidAnaumentEycention( messace: ""MatchActivitvCrmlatal Cannot find activitv.!)CryfSconnection->transaction(function ( use (Sactivity, $crmActivityService, SactivityRepository) {Log::info( message)aculvity → scnis->aculvitylo"remote search" o schis->remoresearch'set confiquration' => Sthis->fromConfiquration?->qetIdo.'old state' =>['Lead_1d' => sactivity-›qetLeado?-›gecldo.'contact id' => Sactivity->qetContactO?->qetIdo'account 1d => sactivity->qetAccounto?->qetldo"opportunity_1d" =› sactivity->getupportunity?-›getiao."stage 1d' = sactzvitv-›cetstade0r->qet.d0.Sthis->resetCrmMappinasSactivitv. SactivitvRepositorv):sthis->switchcrmconfiaunat.ionl-NeededSactivi.tvSactivitv->refrechO.ScrmActivityService->updateCrmDpta(activity: Sactivity.nemotoSeanch• Gthic-snomatoCoanchShasMatch = $activity->getLead !== nullI1 Sactivity->getContact !== nullI1 Sactivity->getAccount0 !== nullI| Sactivity->getOpportunityO !== null:if (ShasMatch) {Loq::intolnlessage: '[MatchActivitvCrmDatal Successfully matched CRM data'. [HoAEGEeUP Y Cthie Contiuszutal=custom.logElaravel.log4 SF jiminny@localhost]A HS_local [jiminny@localhost]tiò accounts jiminny@localhost]A console (PROD]# console [eu)A console [STAGING]clarelscrict-cypes=l)mespace Jiminny Component Utility Service:› e ...ass ProviderRateL1m1tenpublic function __construct(RateLimiter SrateLimiter)t...}oublic function canMakeReguestRateLimited Sorovider): bool** Ovan Ratel imitintenface Sratol imit */foreach ($provider->getRateLimits() as $rateLimit) {if (Sthis->rateLimiter->tooManyAttempts($key, $rateLimit->getQuotaO)) {romlinataeprecurn true.pubLic tunction requestava1lableln RateLimited Sprovider: 1ntreturn Sprovider->qetrateL1m1tso->1sNotzmptyoSprovider->qetRateLimits@)->man(fn (RateLimitInterface SrateLimit): int => Sthis->max@nuhiaic Function incrementRequestcountRateimited Sarovider): void/** @var RateLimitInterface $rateLimit */forpach(Snroviden->aetRatelimitco as Sratelimit)&Sthis->natel imiten.hit«Sratel imit->aetkevol. Cnatelimit->aetWindowOn•-›avanlableincratelimthhlDally - Platorm• In 15m100% LzFri 8 May 9:26:45CascadeHubspot Rate LimitingHubSpot Rate Limit HPart 1: Why 1300 Activities → 2600 Jobs (Step-by-Step)Step 1: One Delete Job Loops Through ActivitiesDeleteCrmEntityTrait.php:43-76eohoSactivities-seach(function (Activity Sactivity) use (...) ‹I For 1300 activities. this runs 1300 timedSactivity->update(['account idSdispatcher->dispatch(new DetachActivity0bject(Sactivity, $crmObject)): // - 1300 eventsResult after Sten 1: 1300 DetachAct ivitvObiect events fired (one per activitv).Step 2: Listener Reacts to Each EventRematchAct1v1ty0nCrm0b1ectDetach.php:76-86i ohonew MatchActivityCrmData(activityId: ..., remoteSearch: false),II JoDnew Cheскаnокeсrукemoremacchactivicyld:... crmObiect. ...,1→disoatcho:For each of the 1300 events, the listener dispatches a chain of 2 jobs.• 1300 x Matchactivitvermbata (local search. remoteSearch=talse ))• 1300 x CheckAndRetryRemoteMatchStep 3: CheckAndRetryRemoteMatch May Dispatch AnotherCheckAndRetrvRemoteMatch.php: 46-86if (ShasMatch)recurn;// No new job if local match succeededI Otherwice disnatch remote cearchiSdispatcher->dispatch(new MatchActivityCrmData(activityId: .... remoteSearch: true)):+0 ..If local search fails (most common after a delete), this dispatches a third MatchActivityCrmData (with remoteSearch=true)Step 4: Final.Job CountsJob TypeCountHits HubSoot Search Apl?MatchActivityCrmData (local)X No (DB only)1300No (DB onlvYou've used 98% of your quota. Quota resets May 8, 11:00 AM GMT+38 files +82* Reiect allAccent alliAsk anvthina (&4D)Claude Onus 4.7 Medium112-46UTE.8Ifo 4 spaces...
|
iTerm2
|
NULL
|
NULL
|
6437
|
|
6438
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
8
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm;
use Exception;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Jobs\Job;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmActivityService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Throwable;
class MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique
{
use InteractsWithQueue;
use SerializesModels;
public int $tries = 3;
private int $activityId;
private ?Configuration $fromConfiguration;
private bool $remoteSearch;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(
int $activityId,
?Configuration $fromConfiguration = null,
bool $remoteSearch = false,
) {
$this->activityId = $activityId;
$this->fromConfiguration = $fromConfiguration;
$this->remoteSearch = $remoteSearch;
$this->onQueue(Constants::QUEUE_ANALYTICS_LOW);
}
public function uniqueId(): string
{
$configId = $this->fromConfiguration?->getId() ?? 0;
$remote = $this->remoteSearch ? 'remote' : 'local';
return "$this->activityId:$configId:$remote";
}
public function timeout(): int
{
return 300; // 5 minutes max execution time
}
public function uniqueFor(): int
{
return $this->timeout() + 60; // timeout + 1 minute buffer
}
public function backoff(): array
{
return [30, 90, 180];
}
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception|Throwable
*/
public function handle(
ActivityRepository $activityRepository,
CrmActivityService $crmActivityService,
Connection $connection,
): void {
$activity = $activityRepository->findById($this->activityId);
if ($activity === null) {
throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');
}
try {
$connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {
Log::info('[MatchActivityCrmData] Starting CRM data matching', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'set_configuration' => $this->fromConfiguration?->getId(),
'old_state' => [
'lead_id' => $activity->getLead()?->getId(),
'contact_id' => $activity->getContact()?->getId(),
'account_id' => $activity->getAccount()?->getId(),
'opportunity_id' => $activity->getOpportunity()?->getId(),
'stage_id' => $activity->getStage()?->getId(),
],
]);
$this->resetCrmMappings($activity, $activityRepository);
$this->switchCrmConfigurationIfNeeded($activity);
$activity->refresh();
$crmActivityService->updateCrmData(
activity: $activity,
remoteSearch: $this->remoteSearch,
);
$hasMatch = $activity->getLead() !== null
|| $activity->getContact() !== null
|| $activity->getAccount() !== null
|| $activity->getOpportunity() !== null;
if ($hasMatch) {
Log::info('[MatchActivityCrmData] Successfully matched CRM data', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'lead_id' => $activity->getLead()?->getId(),
'contact_id' => $activity->getContact()?->getId(),
'account_id' => $activity->getAccount()?->getId(),
'opportunity_id' => $activity->getOpportunity()?->getId(),
'stage_id' => $activity->getStage()?->getId(),
]);
} else {
Log::info('[MatchActivityCrmData] No CRM match found', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
]);
}
});
} catch (Throwable $e) {
Log::error('[MatchActivityCrmData] Failed to match CRM data', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'exception' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
public function failed(Throwable $exception): void
{
Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'from_configuration' => $this->fromConfiguration?->getId(),
'exception' => $exception->getMessage(),
'attempts' => $this->attempts(),
]);
}
private function resetCrmMappings(
Activity $activity,
ActivityRepository $activityRepository
): void {
$activity->update([
'lead_id' => null,
'contact_id' => null,
'account_id' => null,
'opportunity_id' => null,
'stage_id' => null,
]);
$participantsOldState = $activityRepository->getActivityParticipants($activity)
->map(function ($participant) {
return [
'id' => $participant->id,
'user_id' => $participant->user_id,
'contact_id' => $participant->contact_id,
'lead_id' => $participant->lead_id,
];
});
if ($participantsOldState->isNotEmpty()) {
Log::info('[MatchActivityCrmData] Participants old state', [
'activity' => $this->activityId,
'participants' => $participantsOldState->toArray(),
]);
}
$activity->participants()->update([
'user_id' => null,
'contact_id' => null,
'lead_id' => null,
]);
}
private function switchCrmConfigurationIfNeeded(Activity $activity): void
{
if ($this->fromConfiguration === null) {
return;
}
if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {
return;
}
Log::info('[MatchActivityCrmData] Switching CRM configuration', [
'activity' => $this->activityId,
'old_configuration' => $activity->getCrm()?->getId(),
'new_configuration' => $this->fromConfiguration->getId(),
]);
$activity->update([
'crm_configuration_id' => $this->fromConfiguration->getId(),
'crm_provider_id' => null,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
Component, folder
Acl, folder
ActionItems, folder
Activity, folder
ActivityAnalytics, folder
ActivitySearch, folder
AiActivityType, folder
AiAutomation, folder
AiCallScoring, folder
AskAnything, folder
Dtos, folder
Events, folder
AskAnythingPromptService.php
HistoryService.php
AskJiminnyAi, folder
AWS, folder
BillingManagement, folder
Cache, folder
CoachingFeedback, folder
Country, folder
CustomerApi, folder
Database, folder
Datadog, folder
DateTime, folder
DealInsights, folder
DealRisks, folder
ElasticSearch, folder
Eloquent, folder
Encoding, folder
Encryption, folder
ES, folder
Faker, folder
FeatureFlags, folder
FFMpeg, folder
FileSystem, folder
Gecko, folder
Gong, folder
GuzzleHttp, folder
KeyPoints, folder
Kiosk, folder
LanguageDetection, folder
LiveFeed, folder
Locks, folder
Math, folder
MediaPipeline, folder
MeetingBot, folder
MobileSettings, folder
Model, folder
Notification, folder
Nudge, folder
ParagraphBreaker, folder
ParticipantSpeech, folder
PartitionedCookie, folder
PlaybackPage, folder
Playlist, folder
Prophet, folder
ProphetAi, folder
ProsperWorks, folder
Queue, folder
Job, folder
RateLimitAware.php
RateLimitAwareWrapper.php
BotsQueueConstants.php
Constants.php
ProcessingQueueConstants.php
Router, folder
Saml2, folder
SCIM, folder
Seeder, folder
Sentry, folder
Serializer, folder
Settings, folder
Sidekick, folder
Slack, folder
TeamInsights, folder...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
NULL
|
6438
|
|
6439
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
8
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm;
use Exception;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Jobs\Job;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Crm\Configuration;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmActivityService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Throwable;
class MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique
{
use InteractsWithQueue;
use SerializesModels;
public int $tries = 3;
private int $activityId;
private ?Configuration $fromConfiguration;
private bool $remoteSearch;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(
int $activityId,
?Configuration $fromConfiguration = null,
bool $remoteSearch = false,
) {
$this->activityId = $activityId;
$this->fromConfiguration = $fromConfiguration;
$this->remoteSearch = $remoteSearch;
$this->onQueue(Constants::QUEUE_ANALYTICS_LOW);
}
public function uniqueId(): string
{
$configId = $this->fromConfiguration?->getId() ?? 0;
$remote = $this->remoteSearch ? 'remote' : 'local';
return "$this->activityId:$configId:$remote";
}
public function timeout(): int
{
return 300; // 5 minutes max execution time
}
public function uniqueFor(): int
{
return $this->timeout() + 60; // timeout + 1 minute buffer
}
public function backoff(): array
{
return [30, 90, 180];
}
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception|Throwable
*/
public function handle(
ActivityRepository $activityRepository,
CrmActivityService $crmActivityService,
Connection $connection,
): void {
$activity = $activityRepository->findById($this->activityId);
if ($activity === null) {
throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');
}
try {
$connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {
Log::info('[MatchActivityCrmData] Starting CRM data matching', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'set_configuration' => $this->fromConfiguration?->getId(),
'old_state' => [
'lead_id' => $activity->getLead()?->getId(),
'contact_id' => $activity->getContact()?->getId(),
'account_id' => $activity->getAccount()?->getId(),
'opportunity_id' => $activity->getOpportunity()?->getId(),
'stage_id' => $activity->getStage()?->getId(),
],
]);
$this->resetCrmMappings($activity, $activityRepository);
$this->switchCrmConfigurationIfNeeded($activity);
$activity->refresh();
$crmActivityService->updateCrmData(
activity: $activity,
remoteSearch: $this->remoteSearch,
);
$hasMatch = $activity->getLead() !== null
|| $activity->getContact() !== null
|| $activity->getAccount() !== null
|| $activity->getOpportunity() !== null;
if ($hasMatch) {
Log::info('[MatchActivityCrmData] Successfully matched CRM data', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'lead_id' => $activity->getLead()?->getId(),
'contact_id' => $activity->getContact()?->getId(),
'account_id' => $activity->getAccount()?->getId(),
'opportunity_id' => $activity->getOpportunity()?->getId(),
'stage_id' => $activity->getStage()?->getId(),
]);
} else {
Log::info('[MatchActivityCrmData] No CRM match found', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
]);
}
});
} catch (Throwable $e) {
Log::error('[MatchActivityCrmData] Failed to match CRM data', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'exception' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
public function failed(Throwable $exception): void
{
Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [
'activity' => $this->activityId,
'remote_search' => $this->remoteSearch,
'from_configuration' => $this->fromConfiguration?->getId(),
'exception' => $exception->getMessage(),
'attempts' => $this->attempts(),
]);
}
private function resetCrmMappings(
Activity $activity,
ActivityRepository $activityRepository
): void {
$activity->update([
'lead_id' => null,
'contact_id' => null,
'account_id' => null,
'opportunity_id' => null,
'stage_id' => null,
]);
$participantsOldState = $activityRepository->getActivityParticipants($activity)
->map(function ($participant) {
return [
'id' => $participant->id,
'user_id' => $participant->user_id,
'contact_id' => $participant->contact_id,
'lead_id' => $participant->lead_id,
];
});
if ($participantsOldState->isNotEmpty()) {
Log::info('[MatchActivityCrmData] Participants old state', [
'activity' => $this->activityId,
'participants' => $participantsOldState->toArray(),
]);
}
$activity->participants()->update([
'user_id' => null,
'contact_id' => null,
'lead_id' => null,
]);
}
private function switchCrmConfigurationIfNeeded(Activity $activity): void
{
if ($this->fromConfiguration === null) {
return;
}
if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {
return;
}
Log::info('[MatchActivityCrmData] Switching CRM configuration', [
'activity' => $this->activityId,
'old_configuration' => $activity->getCrm()?->getId(),
'new_configuration' => $this->fromConfiguration->getId(),
]);
$activity->update([
'crm_configuration_id' => $this->fromConfiguration->getId(),
'crm_provider_id' => null,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
Component, folder
Acl, folder
ActionItems, folder
Activity, folder
ActivityAnalytics, folder
ActivitySearch, folder
AiActivityType, folder
AiAutomation, folder
AiCallScoring, folder
AskAnything, folder
Dtos, folder
Events, folder
AskAnythingPromptService.php
HistoryService.php
AskJiminnyAi, folder
AWS, folder
BillingManagement, folder
Cache, folder
CoachingFeedback, folder
Country, folder
CustomerApi, folder
Database, folder
Datadog, folder
DateTime, folder
DealInsights, folder
DealRisks, folder
ElasticSearch, folder
Eloquent, folder
Encoding, folder
Encryption, folder
ES, folder
Faker, folder
FeatureFlags, folder
FFMpeg, folder
FileSystem, folder
Gecko, folder
Gong, folder
GuzzleHttp, folder
KeyPoints, folder
Kiosk, folder
LanguageDetection, folder
LiveFeed, folder
Locks, folder
Math, folder
MediaPipeline, folder
MeetingBot, folder
MobileSettings, folder
Model, folder
Notification, folder
Nudge, folder
ParagraphBreaker, folder
ParticipantSpeech, folder
PartitionedCookie, folder
PlaybackPage, folder
Playlist, folder
Prophet, folder
ProphetAi, folder
ProsperWorks, folder
Queue, folder
Job, folder
RateLimitAware.php
RateLimitAwareWrapper.php
BotsQueueConstants.php
Constants.php
ProcessingQueueConstants.php
Router, folder
Saml2, folder
SCIM, folder
Seeder, folder
Sentry, folder
Serializer, folder
Settings, folder
Sidekick, folder
Slack, folder
TeamInsights, folder
TimeMemoryMapper, folder
Transcription, folder
TranscriptionSummary, folder
Twilio, folder
Uploader, folder
UrlGenerator, folder
Utility, folder
Exceptions, folder
Service, folder
BaseRateLimiter.php, class
EfficientJsonParser.php, class
ProviderRateLimiter.php, class
RateLimiterInstance.php, class
Uuid, folder
Waveform, folder
Webhooks, folder
Workflow, folder
Configuration, folder
Console, folder
Commands, folder
Activities, folder
Analytics, folder
Calendars, folder
Crm, folder
Hubspot, folder
IntegrationApp, folder
Traits, folder
AddLayoutEntities.php, class
AutologDelayedCommand.php, class
BullhornCommandAbstract.php, abstract class
BullhornPingCommand.php, class
BullhornSearchCommand.php, class
BullhornSessionCommand.php, class
CheckActivityLoggableCommand.php, final class
CleanDuplicateFieldDataCommand.php, class
FullSyncOpportunityCommand.php, class
LogActivitiesCommand.php, final class
ManageSyncStrategyCommand.php, class
MatchCrmObjectsCommand.php, class
MatchOpportunityActivitiesCommand.php, class
MigrateProvider.php, class
ProcessHubspotObjectsSyncBatches.php, class
PurgeDeletedOpportunitiesCommand.php, class
ResetGovernorLimits.php, class
SendNotLogged.php, class
SetupActivityTypeForFollowUp.php, final class
SetupCloseCrm.php, class
SetupCopperCrm.php, class
SetupCrmCommand.php, abstract class
SetupLayouts.php, class
SyncAccount.php, class
SyncContact.php, class
SyncFieldMetadata.php, class
SyncHubspotActiveDeals.php, class
SyncHubspotObjects.php, class
SyncLead.php, class
SyncObjects.php, class
SyncOpportunitiesMissingFieldDataCommand.php, class
SyncOpportunity.php, class
SyncProfileMetadata.php, class
SyncTeamMetadata.php, class
UpdateOpportunitySpecifications.php
DealInsights, folder
Dev, folder
AddRateLimitCommand.php
FixHubSpotTokens.php
FixMissMatchedCrmActivitiesCommand.php
ImportCallsCommand.php
MonitorSocialAccountsState.php
Dialers, folder
DTOs, folder
Elasticsearch, folder
EngagementStats, folder
GeckoExport, folder
Livestream, folder
Mailboxes, folder
Migrate, folder
PlaybackThemes, folder
Playbooks, folder
Playlists, folder
Postmark, folder
ProphetAi, folder
Reports, folder
AutomatedReportsCommand.php
AutomatedReportsRetentionPolicyCommand.php
AutomatedReportsSendCommand.php
CreateMockAskJiminnyReportResultCommand.php
DeleteReportCommand.php
GenerateMarketingReport.php
Team.php
Usage.php
Slack, folder
Teams, folder
Tracks, folder
Transcription, folder
Twilio, folder
Users, folder
Vocabulary, folder
Zoom, folder
Command.php
CreateDatabaseUsers.php
DatabaseTableCount.php
DeleteOldAiCrmNotesCommand.php
DeleteS3LeftoversCommand.php
DevPostmanCommand.php
DiarizeViaAiParticipantIdentificationCommand.php
EncryptTokensCommand.php
EngagementStatsRegenerateCommand.php
FeatureFlagsHelper.php
FixCrossTenantIssues.php...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
NULL
|
6439
|
|
6440
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
1
5
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm;
use Illuminate\Support\Collection;
use Jiminny\Contracts\Repositories\TeamRepository;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Account;
use Jiminny\Models\Activity;
use Jiminny\Models\Contact;
use Jiminny\Models\Lead;
use Jiminny\Models\Opportunity;
use Jiminny\Models\Participant;
use Jiminny\Models\Stage;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
use Exception;
use Throwable;
class CrmActivityService
{
public function __construct(
private readonly TeamRepository $teamRepository,
private readonly CachedCrmServiceDecorator $decorator,
private readonly EmailHelper $emailHelper,
private readonly ResolveTeamCrmConnection $teamCrmResolver,
private readonly LoggerInterface $logger,
) {
}
/**
* Updates CRM data for an activity and its participants.
*
* NOTE: This method performs multiple database writes and should be called
* within a transaction by the caller to ensure atomicity.
*
* @param Activity $activity
* @param bool $remoteSearch
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function updateCrmData(
Activity $activity,
bool $remoteSearch = false,
): void {
$crmService = null;
$participants = $activity->getParticipants();
$team = $activity->getTeam();
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
$this->logger->info('[CrmActivityService] Ignoring crm data because of prospect strategy', [
'activity_id' => $activity->getId(),
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if ($remoteSearch) {
try {
$crmService = $this->teamCrmResolver->resolveForTeam($team);
} catch (SocialAccountTokenInvalidException) {
$this->logger->warning('[CrmActivityService] CRM token expired, falling back to local search', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
]);
}
}
$records = $this->updateParticipantsCrmData(
team: $team,
activity: $activity,
participants: $participants,
crmService: $crmService,
);
if (! empty($records)) {
$activity->updateActivityCrmData($records);
}
$activity->refresh();
}
/**
* @param Collection<Participant> $participants
*
* @throws Exception
*
* @return array{
* Lead|null,
* Account|null,
* Opportunity|null,
* Contact|null,
* Stage|null,
* string|null
*}|array{}
*/
private function updateParticipantsCrmData(
Team $team,
Activity $activity,
Collection $participants,
?ServiceInterface $crmService = null,
): array {
$matchedRecords = [];
$matchedDomainRecords = [];
$this->validateCrmConfiguration($activity);
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
foreach ($participants as $participant) {
if ($this->shouldSkipParticipant($participant)) {
continue;
}
if (! $this->shouldPerformLookup($participant, $team)) {
$this->logger->info('[CrmActivityService] Email domain belongs to the team, skipping crm lookup', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
'email' => $participant->getEmailAddress(),
]);
$this->attachUserIfExists($participant, $team);
continue;
}
$records = $this->findCrmRecords($participant, $activity);
if (! empty($records)) {
$matchedRecords[] = $records;
} else {
$records = $this->findCrmDomainRecords(
crmService: $crmService,
participant: $participant,
activity: $activity,
);
if (! empty($records)) {
$matchedDomainRecords[] = $records;
}
}
if (empty($records)) {
continue;
}
try {
$activity->updateParticipantCrmData($records, $participant);
} catch (Throwable $ex) {
$this->logger->error('[CrmActivityService] Failed to update participant CRM data', [
'activity_id' => $activity->getId(),
'participant_id' => $participant->getId(),
'exception' => $ex->getMessage(),
]);
continue;
}
}
$bestMatch = $this->getBestMatch(
matchedRecords : $matchedRecords,
matchedDomainRecords: $matchedDomainRecords,
);
$this->logger->info('[CrmActivityService] CRM matching completed', [
'activity_id' => $activity->getId(),
'participants_processed' => $participants->count(),
'exact_matches' => count($matchedRecords),
'domain_matches' => count($matchedDomainRecords),
'best_match_found' => ! empty($bestMatch),
]);
return $bestMatch;
}
private function shouldPerformLookup(Participant $participant, Team $team): bool
{
if ($participant->hasEmailAddress()) {
return $this->emailHelper->shouldPerformLookup($team, $participant->getEmailAddress());
}
return true;
}
private function validateCrmConfiguration(Activity $activity): void
{
if ($activity->getCrm() === null) {
throw new InvalidArgumentException('Cannot find CRM configuration');
}
}
private function getBestMatch(?array $matchedRecords, ?array $matchedDomainRecords): array
{
return RecordSelector::pickBestFromLists($matchedRecords, $matchedDomainRecords);
}
private function findCrmRecords(Participant $participant, Activity $activity): ?array
{
$records = null;
if ($participant->hasEmailAddress()) {
$records = $this->decorator->matchExactlyByEmail(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
}
if (empty($records) && $participant->getPhoneNumber() !== null) {
$records = $this->decorator->matchByPhone(
phone: $participant->getPhoneNumber(),
userId: $activity->getUser()->getId(),
);
}
if (empty($records) && $participant->getName() !== null) {
$records = $this->decorator->matchByName(
name: $participant->getName(),
userId: $activity->getUser()->getId(),
);
}
return $records;
}
private function shouldSkipParticipant(Participant $participant): bool
{
return $participant->hasUser();
}
private function attachUserIfExists(Participant $participant, Team $team): void
{
if ($participant->hasEmailAddress() === false) {
return;
}
$user = $this->teamRepository->findActiveTeamMemberByEmail($team, $participant->getEmailAddress());
if ($user instanceof User) {
$participant->user_id = $user->getId();
$participant->save();
}
}
private function findCrmDomainRecords(
?ServiceInterface $crmService,
Participant $participant,
Activity $activity,
): array {
if ($participant->hasEmailAddress()) {
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
$records = $this->decorator->matchByDomain(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
if (! empty($records)) {
return $records;
}
}
return [];
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
Component, folder
Acl, folder
ActionItems, folder
Activity, folder
ActivityAnalytics, folder
ActivitySearch, folder
AiActivityType, folder
AiAutomation, folder
AiCallScoring, folder
AskAnything, folder
Dtos, folder
Events, folder
AskAnythingPromptService.php
HistoryService.php
AskJiminnyAi, folder
AWS, folder
BillingManagement, folder
Cache, folder
CoachingFeedback, folder
Country, folder
CustomerApi, folder
Database, folder
Datadog, folder
DateTime, folder
DealInsights, folder
DealRisks, folder
ElasticSearch, folder
Eloquent, folder
Encoding, folder
Encryption, folder
ES, folder
Faker, folder
FeatureFlags, folder
FFMpeg, folder
FileSystem, folder
Gecko, folder
Gong, folder
GuzzleHttp, folder
KeyPoints, folder
Kiosk, folder
LanguageDetection, folder
LiveFeed, folder
Locks, folder
Math, folder
MediaPipeline, folder
MeetingBot, folder
MobileSettings, folder
Model, folder
Notification, folder
Nudge, folder
ParagraphBreaker, folder
ParticipantSpeech, folder
PartitionedCookie, folder
PlaybackPage, folder
Playlist, folder
Prophet, folder
ProphetAi, folder
ProsperWorks, folder
Queue, folder
Job, folder
RateLimitAware.php
RateLimitAwareWrapper.php
BotsQueueConstants.php
Constants.php
ProcessingQueueConstants.php
Router, folder
Saml2, folder
SCIM, folder
Seeder, folder
Sentry, folder
Serializer, folder
Settings, folder
Sidekick, folder
Slack, folder
TeamInsights, folder
TimeMemoryMapper, folder
Transcription, folder
TranscriptionSummary, folder
Twilio, folder
Uploader, folder
UrlGenerator, folder
Utility, folder
Exceptions, folder
Service, folder
BaseRateLimiter.php, class
EfficientJsonParser.php, class
ProviderRateLimiter.php, class
RateLimiterInstance.php, class
Uuid, folder
Waveform, folder
Webhooks, folder
Workflow, folder
Configuration, folder
Console, folder
Commands, folder
Activities, folder
Analytics, folder
Calendars, folder
Crm, folder
Hubspot, folder
IntegrationApp, folder
Traits, folder
AddLayoutEntities.php, class
AutologDelayedCommand.php, class
BullhornCommandAbstract.php, abstract class
BullhornPingCommand.php, class
BullhornSearchCommand.php, class
BullhornSessionCommand.php, class
CheckActivityLoggableCommand.php, final class
CleanDuplicateFieldDataCommand.php, class
FullSyncOpportunityCommand.php, class
LogActivitiesCommand.php, final class
ManageSyncStrategyCommand.php, class
MatchCrmObjectsCommand.php, class
MatchOpportunityActivitiesCommand.php, class
MigrateProvider.php, class
ProcessHubspotObjectsSyncBatches.php, class
PurgeDeletedOpportunitiesCommand.php, class
ResetGovernorLimits.php, class
SendNotLogged.php, class
SetupActivityTypeForFollowUp.php, final class
SetupCloseCrm.php, class
SetupCopperCrm.php, class
SetupCrmCommand.php, abstract class
SetupLayouts.php, class...
|
PhpStorm
|
faVsco.js – CrmActivityService.php
|
NULL
|
6440
|
|
6445
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
1
5
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm;
use Illuminate\Support\Collection;
use Jiminny\Contracts\Repositories\TeamRepository;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Account;
use Jiminny\Models\Activity;
use Jiminny\Models\Contact;
use Jiminny\Models\Lead;
use Jiminny\Models\Opportunity;
use Jiminny\Models\Participant;
use Jiminny\Models\Stage;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
use Exception;
use Throwable;
class CrmActivityService
{
public function __construct(
private readonly TeamRepository $teamRepository,
private readonly CachedCrmServiceDecorator $decorator,
private readonly EmailHelper $emailHelper,
private readonly ResolveTeamCrmConnection $teamCrmResolver,
private readonly LoggerInterface $logger,
) {
}
/**
* Updates CRM data for an activity and its participants.
*
* NOTE: This method performs multiple database writes and should be called
* within a transaction by the caller to ensure atomicity.
*
* @param Activity $activity
* @param bool $remoteSearch
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function updateCrmData(
Activity $activity,
bool $remoteSearch = false,
): void {
$crmService = null;
$participants = $activity->getParticipants();
$team = $activity->getTeam();
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
$this->logger->info('[CrmActivityService] Ignoring crm data because of prospect strategy', [
'activity_id' => $activity->getId(),
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if ($remoteSearch) {
try {
$crmService = $this->teamCrmResolver->resolveForTeam($team);
} catch (SocialAccountTokenInvalidException) {
$this->logger->warning('[CrmActivityService] CRM token expired, falling back to local search', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
]);
}
}
$records = $this->updateParticipantsCrmData(
team: $team,
activity: $activity,
participants: $participants,
crmService: $crmService,
);
if (! empty($records)) {
$activity->updateActivityCrmData($records);
}
$activity->refresh();
}
/**
* @param Collection<Participant> $participants
*
* @throws Exception
*
* @return array{
* Lead|null,
* Account|null,
* Opportunity|null,
* Contact|null,
* Stage|null,
* string|null
*}|array{}
*/
private function updateParticipantsCrmData(
Team $team,
Activity $activity,
Collection $participants,
?ServiceInterface $crmService = null,
): array {
$matchedRecords = [];
$matchedDomainRecords = [];
$this->validateCrmConfiguration($activity);
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
foreach ($participants as $participant) {
if ($this->shouldSkipParticipant($participant)) {
continue;
}
if (! $this->shouldPerformLookup($participant, $team)) {
$this->logger->info('[CrmActivityService] Email domain belongs to the team, skipping crm lookup', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
'email' => $participant->getEmailAddress(),
]);
$this->attachUserIfExists($participant, $team);
continue;
}
$records = $this->findCrmRecords($participant, $activity);
if (! empty($records)) {
$matchedRecords[] = $records;
} else {
$records = $this->findCrmDomainRecords(
crmService: $crmService,
participant: $participant,
activity: $activity,
);
if (! empty($records)) {
$matchedDomainRecords[] = $records;
}
}
if (empty($records)) {
continue;
}
try {
$activity->updateParticipantCrmData($records, $participant);
} catch (Throwable $ex) {
$this->logger->error('[CrmActivityService] Failed to update participant CRM data', [
'activity_id' => $activity->getId(),
'participant_id' => $participant->getId(),
'exception' => $ex->getMessage(),
]);
continue;
}
}
$bestMatch = $this->getBestMatch(
matchedRecords : $matchedRecords,
matchedDomainRecords: $matchedDomainRecords,
);
$this->logger->info('[CrmActivityService] CRM matching completed', [
'activity_id' => $activity->getId(),
'participants_processed' => $participants->count(),
'exact_matches' => count($matchedRecords),
'domain_matches' => count($matchedDomainRecords),
'best_match_found' => ! empty($bestMatch),
]);
return $bestMatch;
}
private function shouldPerformLookup(Participant $participant, Team $team): bool
{
if ($participant->hasEmailAddress()) {
return $this->emailHelper->shouldPerformLookup($team, $participant->getEmailAddress());
}
return true;
}
private function validateCrmConfiguration(Activity $activity): void
{
if ($activity->getCrm() === null) {
throw new InvalidArgumentException('Cannot find CRM configuration');
}
}
private function getBestMatch(?array $matchedRecords, ?array $matchedDomainRecords): array
{
return RecordSelector::pickBestFromLists($matchedRecords, $matchedDomainRecords);
}
private function findCrmRecords(Participant $participant, Activity $activity): ?array
{
$records = null;
if ($participant->hasEmailAddress()) {
$records = $this->decorator->matchExactlyByEmail(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
}
if (empty($records) && $participant->getPhoneNumber() !== null) {
$records = $this->decorator->matchByPhone(
phone: $participant->getPhoneNumber(),
userId: $activity->getUser()->getId(),
);
}
if (empty($records) && $participant->getName() !== null) {
$records = $this->decorator->matchByName(
name: $participant->getName(),
userId: $activity->getUser()->getId(),
);
}
return $records;
}
private function shouldSkipParticipant(Participant $participant): bool
{
return $participant->hasUser();
}
private function attachUserIfExists(Participant $participant, Team $team): void
{
if ($participant->hasEmailAddress() === false) {
return;
}
$user = $this->teamRepository->findActiveTeamMemberByEmail($team, $participant->getEmailAddress());
if ($user instanceof User) {
$participant->user_id = $user->getId();
$participant->save();
}
}
private function findCrmDomainRecords(
?ServiceInterface $crmService,
Participant $participant,
Activity $activity,
): array {
if ($participant->hasEmailAddress()) {
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
$records = $this->decorator->matchByDomain(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
if (! empty($records)) {
return $records;
}
}
return [];
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – CrmActivityService.php
|
NULL
|
6445
|
|
6446
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Component\Utility\Service;
use Illuminate\Cache\RateLimiter;
use Jiminny\Contracts\Http\RateLimited;
use Jiminny\Contracts\Http\RateLimitInterface;
class ProviderRateLimiter
{
protected RateLimiter $rateLimiter;
public function __construct(RateLimiter $rateLimiter)
{
$this->rateLimiter = $rateLimiter;
}
public function canMakeRequest(RateLimited $provider): bool
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$key = $rateLimit->getKey();
if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {
return false;
}
}
return true;
}
public function requestAvailableIn(RateLimited $provider): int
{
return $provider->getRateLimits()->isNotEmpty()
? $provider->getRateLimits()
->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))
->max()
: 0
;
}
public function incrementRequestCount(RateLimited $provider): void
{
/** @var RateLimitInterface $rateLimit */
foreach ($provider->getRateLimits() as $rateLimit) {
$this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());
}
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
1
5
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm;
use Illuminate\Support\Collection;
use Jiminny\Contracts\Repositories\TeamRepository;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\Exceptions\InvalidArgumentException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Account;
use Jiminny\Models\Activity;
use Jiminny\Models\Contact;
use Jiminny\Models\Lead;
use Jiminny\Models\Opportunity;
use Jiminny\Models\Participant;
use Jiminny\Models\Stage;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
use Exception;
use Throwable;
class CrmActivityService
{
public function __construct(
private readonly TeamRepository $teamRepository,
private readonly CachedCrmServiceDecorator $decorator,
private readonly EmailHelper $emailHelper,
private readonly ResolveTeamCrmConnection $teamCrmResolver,
private readonly LoggerInterface $logger,
) {
}
/**
* Updates CRM data for an activity and its participants.
*
* NOTE: This method performs multiple database writes and should be called
* within a transaction by the caller to ensure atomicity.
*
* @param Activity $activity
* @param bool $remoteSearch
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function updateCrmData(
Activity $activity,
bool $remoteSearch = false,
): void {
$crmService = null;
$participants = $activity->getParticipants();
$team = $activity->getTeam();
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
$this->logger->info('[CrmActivityService] Ignoring crm data because of prospect strategy', [
'activity_id' => $activity->getId(),
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if ($remoteSearch) {
try {
$crmService = $this->teamCrmResolver->resolveForTeam($team);
} catch (SocialAccountTokenInvalidException) {
$this->logger->warning('[CrmActivityService] CRM token expired, falling back to local search', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
]);
}
}
$records = $this->updateParticipantsCrmData(
team: $team,
activity: $activity,
participants: $participants,
crmService: $crmService,
);
if (! empty($records)) {
$activity->updateActivityCrmData($records);
}
$activity->refresh();
}
/**
* @param Collection<Participant> $participants
*
* @throws Exception
*
* @return array{
* Lead|null,
* Account|null,
* Opportunity|null,
* Contact|null,
* Stage|null,
* string|null
*}|array{}
*/
private function updateParticipantsCrmData(
Team $team,
Activity $activity,
Collection $participants,
?ServiceInterface $crmService = null,
): array {
$matchedRecords = [];
$matchedDomainRecords = [];
$this->validateCrmConfiguration($activity);
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
foreach ($participants as $participant) {
if ($this->shouldSkipParticipant($participant)) {
continue;
}
if (! $this->shouldPerformLookup($participant, $team)) {
$this->logger->info('[CrmActivityService] Email domain belongs to the team, skipping crm lookup', [
'activity_id' => $activity->getId(),
'team_id' => $team->getId(),
'email' => $participant->getEmailAddress(),
]);
$this->attachUserIfExists($participant, $team);
continue;
}
$records = $this->findCrmRecords($participant, $activity);
if (! empty($records)) {
$matchedRecords[] = $records;
} else {
$records = $this->findCrmDomainRecords(
crmService: $crmService,
participant: $participant,
activity: $activity,
);
if (! empty($records)) {
$matchedDomainRecords[] = $records;
}
}
if (empty($records)) {
continue;
}
try {
$activity->updateParticipantCrmData($records, $participant);
} catch (Throwable $ex) {
$this->logger->error('[CrmActivityService] Failed to update participant CRM data', [
'activity_id' => $activity->getId(),
'participant_id' => $participant->getId(),
'exception' => $ex->getMessage(),
]);
continue;
}
}
$bestMatch = $this->getBestMatch(
matchedRecords : $matchedRecords,
matchedDomainRecords: $matchedDomainRecords,
);
$this->logger->info('[CrmActivityService] CRM matching completed', [
'activity_id' => $activity->getId(),
'participants_processed' => $participants->count(),
'exact_matches' => count($matchedRecords),
'domain_matches' => count($matchedDomainRecords),
'best_match_found' => ! empty($bestMatch),
]);
return $bestMatch;
}
private function shouldPerformLookup(Participant $participant, Team $team): bool
{
if ($participant->hasEmailAddress()) {
return $this->emailHelper->shouldPerformLookup($team, $participant->getEmailAddress());
}
return true;
}
private function validateCrmConfiguration(Activity $activity): void
{
if ($activity->getCrm() === null) {
throw new InvalidArgumentException('Cannot find CRM configuration');
}
}
private function getBestMatch(?array $matchedRecords, ?array $matchedDomainRecords): array
{
return RecordSelector::pickBestFromLists($matchedRecords, $matchedDomainRecords);
}
private function findCrmRecords(Participant $participant, Activity $activity): ?array
{
$records = null;
if ($participant->hasEmailAddress()) {
$records = $this->decorator->matchExactlyByEmail(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
}
if (empty($records) && $participant->getPhoneNumber() !== null) {
$records = $this->decorator->matchByPhone(
phone: $participant->getPhoneNumber(),
userId: $activity->getUser()->getId(),
);
}
if (empty($records) && $participant->getName() !== null) {
$records = $this->decorator->matchByName(
name: $participant->getName(),
userId: $activity->getUser()->getId(),
);
}
return $records;
}
private function shouldSkipParticipant(Participant $participant): bool
{
return $participant->hasUser();
}
private function attachUserIfExists(Participant $participant, Team $team): void
{
if ($participant->hasEmailAddress() === false) {
return;
}
$user = $this->teamRepository->findActiveTeamMemberByEmail($team, $participant->getEmailAddress());
if ($user instanceof User) {
$participant->user_id = $user->getId();
$participant->save();
}
}
private function findCrmDomainRecords(
?ServiceInterface $crmService,
Participant $participant,
Activity $activity,
): array {
if ($participant->hasEmailAddress()) {
$this->decorator->setConfiguration($activity->getCrm());
$this->decorator->setCrmService($crmService);
$records = $this->decorator->matchByDomain(
email: $participant->getEmailAddress(),
userId: $activity->getUser()->getId()
);
if (! empty($records)) {
return $records;
}
}
return [];
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – CrmActivityService.php
|
NULL
|
6446
|