|
6165
|
252
|
0
|
2026-05-07T17:44:43.993626+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778175883993_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6151
|
NULL
|
NULL
|
NULL
|
|
6166
|
251
|
0
|
2026-05-07T17:44:56.796322+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778175896796_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6144
|
NULL
|
NULL
|
NULL
|
|
6182
|
NULL
|
0
|
2026-05-07T17:49:15.815493+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176155815_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6144
|
NULL
|
NULL
|
NULL
|
|
6183
|
NULL
|
0
|
2026-05-07T17:49:21.009890+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176161009_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6181
|
NULL
|
NULL
|
NULL
|
|
6184
|
253
|
0
|
2026-05-07T17:49:46.257266+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176186257_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6144
|
NULL
|
NULL
|
NULL
|
|
6185
|
254
|
0
|
2026-05-07T17:49:51.553363+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176191553_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6181
|
NULL
|
NULL
|
NULL
|
|
6204
|
NULL
|
0
|
2026-05-07T17:54:37.614026+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176477614_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6202
|
NULL
|
NULL
|
NULL
|
|
6205
|
NULL
|
0
|
2026-05-07T17:54:38.155203+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176478155_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6203
|
NULL
|
NULL
|
NULL
|
|
6206
|
255
|
0
|
2026-05-07T17:55:08.108288+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176508108_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6202
|
NULL
|
NULL
|
NULL
|
|
6207
|
256
|
0
|
2026-05-07T17:55:08.740284+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176508740_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6203
|
NULL
|
NULL
|
NULL
|
|
6223
|
NULL
|
0
|
2026-05-07T17:59:39.744318+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176779744_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6216
|
NULL
|
NULL
|
NULL
|
|
6224
|
NULL
|
0
|
2026-05-07T17:59:40.655566+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176780655_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6203
|
NULL
|
NULL
|
NULL
|
|
6225
|
257
|
0
|
2026-05-07T18:00:10.157472+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176810157_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6216
|
NULL
|
NULL
|
NULL
|
|
6226
|
258
|
0
|
2026-05-07T18:00:11.294738+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778176811294_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6203
|
NULL
|
NULL
|
NULL
|
|
6250
|
NULL
|
0
|
2026-05-07T18:04:43.914092+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177083914_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6240
|
NULL
|
NULL
|
NULL
|
|
6251
|
NULL
|
0
|
2026-05-07T18:04:44.112867+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177084112_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6241
|
NULL
|
NULL
|
NULL
|
|
6252
|
260
|
0
|
2026-05-07T18:05:14.484539+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177114484_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6240
|
NULL
|
NULL
|
NULL
|
|
6253
|
259
|
0
|
2026-05-07T18:05:14.745643+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177114745_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6241
|
NULL
|
NULL
|
NULL
|
|
6290
|
NULL
|
0
|
2026-05-07T18:09:03.427872+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177343427_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.22106944,"width":0.2995346,"height":0.77893054},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
visual_change
|
accessibility
|
NULL
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6291
|
NULL
|
0
|
2026-05-07T18:09:32.373197+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177372373_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
click
|
accessibility
|
NULL
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6292
|
261
|
0
|
2026-05-07T18:10:02.931123+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177402931_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.016666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6291
|
NULL
|
NULL
|
NULL
|
|
6293
|
262
|
0
|
2026-05-07T18:10:03.138140+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177403138_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchActivityCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.007978723,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.22106944,"width":0.2995346,"height":0.77893054},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm;\n\nuse Exception;\nuse Illuminate\\Contracts\\Queue\\ShouldBeUnique;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Exceptions\\InvalidArgumentException;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Crm\\Configuration;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmActivityService;\nuse Psr\\Container\\ContainerExceptionInterface;\nuse Psr\\Container\\NotFoundExceptionInterface;\nuse Throwable;\n\nclass MatchActivityCrmData extends Job implements ShouldQueue, ShouldBeUnique\n{\n use InteractsWithQueue;\n use SerializesModels;\n\n public int $tries = 3;\n\n private int $activityId;\n private ?Configuration $fromConfiguration;\n private bool $remoteSearch;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(\n int $activityId,\n ?Configuration $fromConfiguration = null,\n bool $remoteSearch = false,\n ) {\n $this->activityId = $activityId;\n $this->fromConfiguration = $fromConfiguration;\n $this->remoteSearch = $remoteSearch;\n\n $this->onQueue(Constants::QUEUE_ANALYTICS_LOW);\n }\n\n public function uniqueId(): string\n {\n $configId = $this->fromConfiguration?->getId() ?? 0;\n $remote = $this->remoteSearch ? 'remote' : 'local';\n\n return \"$this->activityId:$configId:$remote\";\n }\n\n public function timeout(): int\n {\n return 300; // 5 minutes max execution time\n }\n\n public function uniqueFor(): int\n {\n return $this->timeout() + 60; // timeout + 1 minute buffer\n }\n\n public function backoff(): array\n {\n return [30, 90, 180];\n }\n\n /**\n * @throws ContainerExceptionInterface\n * @throws NotFoundExceptionInterface\n * @throws Exception|Throwable\n */\n public function handle(\n ActivityRepository $activityRepository,\n CrmActivityService $crmActivityService,\n Connection $connection,\n ): void {\n $activity = $activityRepository->findById($this->activityId);\n if ($activity === null) {\n throw new InvalidArgumentException('[MatchActivityCrmData] Cannot find activity.');\n }\n\n try {\n $connection->transaction(function () use ($activity, $crmActivityService, $activityRepository) {\n Log::info('[MatchActivityCrmData] Starting CRM data matching', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'set_configuration' => $this->fromConfiguration?->getId(),\n 'old_state' => [\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ],\n ]);\n\n $this->resetCrmMappings($activity, $activityRepository);\n\n $this->switchCrmConfigurationIfNeeded($activity);\n\n $activity->refresh();\n\n $crmActivityService->updateCrmData(\n activity: $activity,\n remoteSearch: $this->remoteSearch,\n );\n\n $hasMatch = $activity->getLead() !== null\n || $activity->getContact() !== null\n || $activity->getAccount() !== null\n || $activity->getOpportunity() !== null;\n\n if ($hasMatch) {\n Log::info('[MatchActivityCrmData] Successfully matched CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'lead_id' => $activity->getLead()?->getId(),\n 'contact_id' => $activity->getContact()?->getId(),\n 'account_id' => $activity->getAccount()?->getId(),\n 'opportunity_id' => $activity->getOpportunity()?->getId(),\n 'stage_id' => $activity->getStage()?->getId(),\n ]);\n } else {\n Log::info('[MatchActivityCrmData] No CRM match found', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n ]);\n }\n });\n } catch (Throwable $e) {\n Log::error('[MatchActivityCrmData] Failed to match CRM data', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'exception' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n public function failed(Throwable $exception): void\n {\n Log::error('[MatchActivityCrmData] Job permanently failed after all retries', [\n 'activity' => $this->activityId,\n 'remote_search' => $this->remoteSearch,\n 'from_configuration' => $this->fromConfiguration?->getId(),\n 'exception' => $exception->getMessage(),\n 'attempts' => $this->attempts(),\n ]);\n }\n\n private function resetCrmMappings(\n Activity $activity,\n ActivityRepository $activityRepository\n ): void {\n $activity->update([\n 'lead_id' => null,\n 'contact_id' => null,\n 'account_id' => null,\n 'opportunity_id' => null,\n 'stage_id' => null,\n ]);\n\n $participantsOldState = $activityRepository->getActivityParticipants($activity)\n ->map(function ($participant) {\n return [\n 'id' => $participant->id,\n 'user_id' => $participant->user_id,\n 'contact_id' => $participant->contact_id,\n 'lead_id' => $participant->lead_id,\n ];\n });\n\n if ($participantsOldState->isNotEmpty()) {\n Log::info('[MatchActivityCrmData] Participants old state', [\n 'activity' => $this->activityId,\n 'participants' => $participantsOldState->toArray(),\n ]);\n }\n\n $activity->participants()->update([\n 'user_id' => null,\n 'contact_id' => null,\n 'lead_id' => null,\n ]);\n }\n\n private function switchCrmConfigurationIfNeeded(Activity $activity): void\n {\n if ($this->fromConfiguration === null) {\n return;\n }\n\n if ($activity->getCrm()?->getId() === $this->fromConfiguration->getId()) {\n return;\n }\n\n Log::info('[MatchActivityCrmData] Switching CRM configuration', [\n 'activity' => $this->activityId,\n 'old_configuration' => $activity->getCrm()?->getId(),\n 'new_configuration' => $this->fromConfiguration->getId(),\n ]);\n\n $activity->update([\n 'crm_configuration_id' => $this->fromConfiguration->getId(),\n 'crm_provider_id' => null,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2730807366803551277
|
6666527995115800880
|
idle
|
accessibility
|
NULL
|
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...
|
6290
|
NULL
|
NULL
|
NULL
|
|
6316
|
NULL
|
0
|
2026-05-07T18:14:51.461505+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177691461_m1.jpg...
|
PhpStorm
|
faVsco.js – ConferenceCrmMatcherJob.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\User;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Calendar\Adapter\PersistedEventAttendee;
use Jiminny\Services\Calendar\Command\ImportParticipants;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Log\LoggerInterface;
/**
* This job is dispatched after a meeting is finished.
* Its purpose is to validate all final participants, and run crm matching for them,
* in case an opportunity was created during the actual meeting.
*/
class ConferenceCrmMatcherJob implements ShouldQueue
{
use InteractsWithQueue;
use Queueable;
public int $tries = 3;
public int $timeout = 120;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(private readonly int $activityId)
{
}
public function handle(
ActivityRepository $activityRepository,
ResolveTeamCrmConnection $crmResolver,
LoggerInterface $logger,
): void {
$logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [
'activity_id' => $this->activityId,
]);
$activity = $activityRepository->findById($this->activityId);
if (! $activity) {
$logger->warning('[ConferenceCrmMatcherJob] Activity not found', [
'activity_id' => $this->activityId,
]);
return;
}
try {
$user = $activity->getUser();
$persistedAttendees = $this->collectParticipants($activity);
if (empty($persistedAttendees)) {
$logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [
'activity_id' => $this->activityId,
]);
return;
}
$crmService = $crmResolver->resolveForUser($user);
$importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);
$importParticipants->setCrmService($crmService);
$importParticipants->refreshCrmData();
$logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [
'activity_id' => $this->activityId,
'participants_count' => count($persistedAttendees),
]);
} catch (SocialAccountTokenInvalidException $e) {
$logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
]);
// Prevent retries when no social account is available.
$this->fail($e);
} catch (\Exception $e) {
$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
private function collectParticipants(Activity $activity): array
{
$persistedAttendees = [];
$participants = $activity->getParticipants();
$activityOwnerId = $activity->getUserId();
foreach ($participants as $participant) {
$persistedAttendee = new PersistedEventAttendee($participant);
$persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);
if (! $persistedAttendee->email()) {
continue;
}
$persistedAttendees[] = $persistedAttendee;
}
return $persistedAttendees;
}
private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants
{
return app(ImportParticipants::class, [
'user' => $user,
'activity' => $activity,
'attendees' => $attendees,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Calendar\\Adapter\\PersistedEventAttendee;\nuse Jiminny\\Services\\Calendar\\Command\\ImportParticipants;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse Psr\\Log\\LoggerInterface;\n\n/**\n * This job is dispatched after a meeting is finished.\n * Its purpose is to validate all final participants, and run crm matching for them,\n * in case an opportunity was created during the actual meeting.\n */\nclass ConferenceCrmMatcherJob implements ShouldQueue\n{\n use InteractsWithQueue;\n use Queueable;\n\n public int $tries = 3;\n public int $timeout = 120;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(private readonly int $activityId)\n {\n }\n\n public function handle(\n ActivityRepository $activityRepository,\n ResolveTeamCrmConnection $crmResolver,\n LoggerInterface $logger,\n ): void {\n $logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n ]);\n\n $activity = $activityRepository->findById($this->activityId);\n\n if (! $activity) {\n $logger->warning('[ConferenceCrmMatcherJob] Activity not found', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n try {\n $user = $activity->getUser();\n\n $persistedAttendees = $this->collectParticipants($activity);\n if (empty($persistedAttendees)) {\n $logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n $crmService = $crmResolver->resolveForUser($user);\n\n $importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);\n $importParticipants->setCrmService($crmService);\n $importParticipants->refreshCrmData();\n\n $logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [\n 'activity_id' => $this->activityId,\n 'participants_count' => count($persistedAttendees),\n ]);\n } catch (SocialAccountTokenInvalidException $e) {\n $logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n ]);\n\n // Prevent retries when no social account is available.\n $this->fail($e);\n } catch (\\Exception $e) {\n $logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n private function collectParticipants(Activity $activity): array\n {\n $persistedAttendees = [];\n $participants = $activity->getParticipants();\n $activityOwnerId = $activity->getUserId();\n\n foreach ($participants as $participant) {\n $persistedAttendee = new PersistedEventAttendee($participant);\n $persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);\n\n if (! $persistedAttendee->email()) {\n continue;\n }\n\n $persistedAttendees[] = $persistedAttendee;\n }\n\n return $persistedAttendees;\n }\n\n private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants\n {\n return app(ImportParticipants::class, [\n 'user' => $user,\n 'activity' => $activity,\n 'attendees' => $attendees,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Calendar\\Adapter\\PersistedEventAttendee;\nuse Jiminny\\Services\\Calendar\\Command\\ImportParticipants;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse Psr\\Log\\LoggerInterface;\n\n/**\n * This job is dispatched after a meeting is finished.\n * Its purpose is to validate all final participants, and run crm matching for them,\n * in case an opportunity was created during the actual meeting.\n */\nclass ConferenceCrmMatcherJob implements ShouldQueue\n{\n use InteractsWithQueue;\n use Queueable;\n\n public int $tries = 3;\n public int $timeout = 120;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(private readonly int $activityId)\n {\n }\n\n public function handle(\n ActivityRepository $activityRepository,\n ResolveTeamCrmConnection $crmResolver,\n LoggerInterface $logger,\n ): void {\n $logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n ]);\n\n $activity = $activityRepository->findById($this->activityId);\n\n if (! $activity) {\n $logger->warning('[ConferenceCrmMatcherJob] Activity not found', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n try {\n $user = $activity->getUser();\n\n $persistedAttendees = $this->collectParticipants($activity);\n if (empty($persistedAttendees)) {\n $logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n $crmService = $crmResolver->resolveForUser($user);\n\n $importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);\n $importParticipants->setCrmService($crmService);\n $importParticipants->refreshCrmData();\n\n $logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [\n 'activity_id' => $this->activityId,\n 'participants_count' => count($persistedAttendees),\n ]);\n } catch (SocialAccountTokenInvalidException $e) {\n $logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n ]);\n\n // Prevent retries when no social account is available.\n $this->fail($e);\n } catch (\\Exception $e) {\n $logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n private function collectParticipants(Activity $activity): array\n {\n $persistedAttendees = [];\n $participants = $activity->getParticipants();\n $activityOwnerId = $activity->getUserId();\n\n foreach ($participants as $participant) {\n $persistedAttendee = new PersistedEventAttendee($participant);\n $persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);\n\n if (! $persistedAttendee->email()) {\n continue;\n }\n\n $persistedAttendees[] = $persistedAttendee;\n }\n\n return $persistedAttendees;\n }\n\n private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants\n {\n return app(ImportParticipants::class, [\n 'user' => $user,\n 'activity' => $activity,\n 'attendees' => $attendees,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6936887013967671323
|
-3995744045677024801
|
click
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\User;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Calendar\Adapter\PersistedEventAttendee;
use Jiminny\Services\Calendar\Command\ImportParticipants;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Log\LoggerInterface;
/**
* This job is dispatched after a meeting is finished.
* Its purpose is to validate all final participants, and run crm matching for them,
* in case an opportunity was created during the actual meeting.
*/
class ConferenceCrmMatcherJob implements ShouldQueue
{
use InteractsWithQueue;
use Queueable;
public int $tries = 3;
public int $timeout = 120;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(private readonly int $activityId)
{
}
public function handle(
ActivityRepository $activityRepository,
ResolveTeamCrmConnection $crmResolver,
LoggerInterface $logger,
): void {
$logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [
'activity_id' => $this->activityId,
]);
$activity = $activityRepository->findById($this->activityId);
if (! $activity) {
$logger->warning('[ConferenceCrmMatcherJob] Activity not found', [
'activity_id' => $this->activityId,
]);
return;
}
try {
$user = $activity->getUser();
$persistedAttendees = $this->collectParticipants($activity);
if (empty($persistedAttendees)) {
$logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [
'activity_id' => $this->activityId,
]);
return;
}
$crmService = $crmResolver->resolveForUser($user);
$importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);
$importParticipants->setCrmService($crmService);
$importParticipants->refreshCrmData();
$logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [
'activity_id' => $this->activityId,
'participants_count' => count($persistedAttendees),
]);
} catch (SocialAccountTokenInvalidException $e) {
$logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
]);
// Prevent retries when no social account is available.
$this->fail($e);
} catch (\Exception $e) {
$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
private function collectParticipants(Activity $activity): array
{
$persistedAttendees = [];
$participants = $activity->getParticipants();
$activityOwnerId = $activity->getUserId();
foreach ($participants as $participant) {
$persistedAttendee = new PersistedEventAttendee($participant);
$persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);
if (! $persistedAttendee->email()) {
continue;
}
$persistedAttendees[] = $persistedAttendee;
}
return $persistedAttendees;
}
private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants
{
return app(ImportParticipants::class, [
'user' => $user,
'activity' => $activity,
'attendees' => $attendees,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6317
|
NULL
|
0
|
2026-05-07T18:14:52.544208+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177692544_m2.jpg...
|
PhpStorm
|
faVsco.js – ConferenceCrmMatcherJob.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\User;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Calendar\Adapter\PersistedEventAttendee;
use Jiminny\Services\Calendar\Command\ImportParticipants;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Log\LoggerInterface;
/**
* This job is dispatched after a meeting is finished.
* Its purpose is to validate all final participants, and run crm matching for them,
* in case an opportunity was created during the actual meeting.
*/
class ConferenceCrmMatcherJob implements ShouldQueue
{
use InteractsWithQueue;
use Queueable;
public int $tries = 3;
public int $timeout = 120;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(private readonly int $activityId)
{
}
public function handle(
ActivityRepository $activityRepository,
ResolveTeamCrmConnection $crmResolver,
LoggerInterface $logger,
): void {
$logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [
'activity_id' => $this->activityId,
]);
$activity = $activityRepository->findById($this->activityId);
if (! $activity) {
$logger->warning('[ConferenceCrmMatcherJob] Activity not found', [
'activity_id' => $this->activityId,
]);
return;
}
try {
$user = $activity->getUser();
$persistedAttendees = $this->collectParticipants($activity);
if (empty($persistedAttendees)) {
$logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [
'activity_id' => $this->activityId,
]);
return;
}
$crmService = $crmResolver->resolveForUser($user);
$importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);
$importParticipants->setCrmService($crmService);
$importParticipants->refreshCrmData();
$logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [
'activity_id' => $this->activityId,
'participants_count' => count($persistedAttendees),
]);
} catch (SocialAccountTokenInvalidException $e) {
$logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
]);
// Prevent retries when no social account is available.
$this->fail($e);
} catch (\Exception $e) {
$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
private function collectParticipants(Activity $activity): array
{
$persistedAttendees = [];
$participants = $activity->getParticipants();
$activityOwnerId = $activity->getUserId();
foreach ($participants as $participant) {
$persistedAttendee = new PersistedEventAttendee($participant);
$persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);
if (! $persistedAttendee->email()) {
continue;
}
$persistedAttendees[] = $persistedAttendee;
}
return $persistedAttendees;
}
private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants
{
return app(ImportParticipants::class, [
'user' => $user,
'activity' => $activity,
'attendees' => $attendees,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Calendar\\Adapter\\PersistedEventAttendee;\nuse Jiminny\\Services\\Calendar\\Command\\ImportParticipants;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse Psr\\Log\\LoggerInterface;\n\n/**\n * This job is dispatched after a meeting is finished.\n * Its purpose is to validate all final participants, and run crm matching for them,\n * in case an opportunity was created during the actual meeting.\n */\nclass ConferenceCrmMatcherJob implements ShouldQueue\n{\n use InteractsWithQueue;\n use Queueable;\n\n public int $tries = 3;\n public int $timeout = 120;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(private readonly int $activityId)\n {\n }\n\n public function handle(\n ActivityRepository $activityRepository,\n ResolveTeamCrmConnection $crmResolver,\n LoggerInterface $logger,\n ): void {\n $logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n ]);\n\n $activity = $activityRepository->findById($this->activityId);\n\n if (! $activity) {\n $logger->warning('[ConferenceCrmMatcherJob] Activity not found', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n try {\n $user = $activity->getUser();\n\n $persistedAttendees = $this->collectParticipants($activity);\n if (empty($persistedAttendees)) {\n $logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n $crmService = $crmResolver->resolveForUser($user);\n\n $importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);\n $importParticipants->setCrmService($crmService);\n $importParticipants->refreshCrmData();\n\n $logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [\n 'activity_id' => $this->activityId,\n 'participants_count' => count($persistedAttendees),\n ]);\n } catch (SocialAccountTokenInvalidException $e) {\n $logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n ]);\n\n // Prevent retries when no social account is available.\n $this->fail($e);\n } catch (\\Exception $e) {\n $logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n private function collectParticipants(Activity $activity): array\n {\n $persistedAttendees = [];\n $participants = $activity->getParticipants();\n $activityOwnerId = $activity->getUserId();\n\n foreach ($participants as $participant) {\n $persistedAttendee = new PersistedEventAttendee($participant);\n $persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);\n\n if (! $persistedAttendee->email()) {\n continue;\n }\n\n $persistedAttendees[] = $persistedAttendee;\n }\n\n return $persistedAttendees;\n }\n\n private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants\n {\n return app(ImportParticipants::class, [\n 'user' => $user,\n 'activity' => $activity,\n 'attendees' => $attendees,\n ]);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Calendar\\Adapter\\PersistedEventAttendee;\nuse Jiminny\\Services\\Calendar\\Command\\ImportParticipants;\nuse Jiminny\\Services\\ResolveTeamCrmConnection;\nuse Psr\\Log\\LoggerInterface;\n\n/**\n * This job is dispatched after a meeting is finished.\n * Its purpose is to validate all final participants, and run crm matching for them,\n * in case an opportunity was created during the actual meeting.\n */\nclass ConferenceCrmMatcherJob implements ShouldQueue\n{\n use InteractsWithQueue;\n use Queueable;\n\n public int $tries = 3;\n public int $timeout = 120;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(private readonly int $activityId)\n {\n }\n\n public function handle(\n ActivityRepository $activityRepository,\n ResolveTeamCrmConnection $crmResolver,\n LoggerInterface $logger,\n ): void {\n $logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n ]);\n\n $activity = $activityRepository->findById($this->activityId);\n\n if (! $activity) {\n $logger->warning('[ConferenceCrmMatcherJob] Activity not found', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n try {\n $user = $activity->getUser();\n\n $persistedAttendees = $this->collectParticipants($activity);\n if (empty($persistedAttendees)) {\n $logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [\n 'activity_id' => $this->activityId,\n ]);\n\n return;\n }\n\n $crmService = $crmResolver->resolveForUser($user);\n\n $importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);\n $importParticipants->setCrmService($crmService);\n $importParticipants->refreshCrmData();\n\n $logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [\n 'activity_id' => $this->activityId,\n 'participants_count' => count($persistedAttendees),\n ]);\n } catch (SocialAccountTokenInvalidException $e) {\n $logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n ]);\n\n // Prevent retries when no social account is available.\n $this->fail($e);\n } catch (\\Exception $e) {\n $logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [\n 'activity_id' => $this->activityId,\n 'error' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n\n throw $e;\n }\n }\n\n private function collectParticipants(Activity $activity): array\n {\n $persistedAttendees = [];\n $participants = $activity->getParticipants();\n $activityOwnerId = $activity->getUserId();\n\n foreach ($participants as $participant) {\n $persistedAttendee = new PersistedEventAttendee($participant);\n $persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);\n\n if (! $persistedAttendee->email()) {\n continue;\n }\n\n $persistedAttendees[] = $persistedAttendee;\n }\n\n return $persistedAttendees;\n }\n\n private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants\n {\n return app(ImportParticipants::class, [\n 'user' => $user,\n 'activity' => $activity,\n 'attendees' => $attendees,\n ]);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6936887013967671323
|
-3995744045677024801
|
click
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\User;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Calendar\Adapter\PersistedEventAttendee;
use Jiminny\Services\Calendar\Command\ImportParticipants;
use Jiminny\Services\ResolveTeamCrmConnection;
use Psr\Log\LoggerInterface;
/**
* This job is dispatched after a meeting is finished.
* Its purpose is to validate all final participants, and run crm matching for them,
* in case an opportunity was created during the actual meeting.
*/
class ConferenceCrmMatcherJob implements ShouldQueue
{
use InteractsWithQueue;
use Queueable;
public int $tries = 3;
public int $timeout = 120;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(private readonly int $activityId)
{
}
public function handle(
ActivityRepository $activityRepository,
ResolveTeamCrmConnection $crmResolver,
LoggerInterface $logger,
): void {
$logger->info('[ConferenceCrmMatcherJob] Trying to refresh activity crm data', [
'activity_id' => $this->activityId,
]);
$activity = $activityRepository->findById($this->activityId);
if (! $activity) {
$logger->warning('[ConferenceCrmMatcherJob] Activity not found', [
'activity_id' => $this->activityId,
]);
return;
}
try {
$user = $activity->getUser();
$persistedAttendees = $this->collectParticipants($activity);
if (empty($persistedAttendees)) {
$logger->info('[ConferenceCrmMatcherJob] No valid participants to process', [
'activity_id' => $this->activityId,
]);
return;
}
$crmService = $crmResolver->resolveForUser($user);
$importParticipants = $this->createImportParticipants($activity, $user, $persistedAttendees);
$importParticipants->setCrmService($crmService);
$importParticipants->refreshCrmData();
$logger->info('[ConferenceCrmMatcherJob] Refresh activity crm data finished', [
'activity_id' => $this->activityId,
'participants_count' => count($persistedAttendees),
]);
} catch (SocialAccountTokenInvalidException $e) {
$logger->error('[ConferenceCrmMatcherJob] CRM token invalid', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
]);
// Prevent retries when no social account is available.
$this->fail($e);
} catch (\Exception $e) {
$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [
'activity_id' => $this->activityId,
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
}
private function collectParticipants(Activity $activity): array
{
$persistedAttendees = [];
$participants = $activity->getParticipants();
$activityOwnerId = $activity->getUserId();
foreach ($participants as $participant) {
$persistedAttendee = new PersistedEventAttendee($participant);
$persistedAttendee->setIsOrganizer($participant->getUserId() === $activityOwnerId);
if (! $persistedAttendee->email()) {
continue;
}
$persistedAttendees[] = $persistedAttendee;
}
return $persistedAttendees;
}
private function createImportParticipants(Activity $activity, User $user, array $attendees): ImportParticipants
{
return app(ImportParticipants::class, [
'user' => $user,
'activity' => $activity,
'attendees' => $attendees,
]);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6318
|
264
|
0
|
2026-05-07T18:15:01.692254+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177701692_m2.jpg...
|
PhpStorm
|
faVsco.js – ConferenceCrmMatcherJob.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormINavigarecodeProiect v© DetachActivityObje PhostormINavigarecodeProiect v© DetachActivityObject.php© ActivityChangeCatego© SyncOpportunitiesJob.php• Cllentonp©Assignownersnip.ongC DelereAcuivities.onpC Delete leamenurnDatac) Delele l eamskerention© HardDeleteActivities.pc) Hubspot/Service.phpC) PayloadBuilder.php(c) CrmActivityService.phoC) CachedCrmServiceDecorator.pho© HardDeleteActivity.pnj ( Hubspot/.../SyncCrmEntitiesTrait.php© MatchMeetingOwner.r© Pipedrive/Service.phpServicelntertace.php© OpportunitySyncTest.phpclass ConferencecrmMatcherJob imolements Shou doueueC) ReindexForAccountJoloublic function handledC) ReindexForcontactJoiC) ReindexForgroupJob.r© ReindexForUser.Job.phC) RetrvActivitvSvnc.lob.n@ SvncActivity.php© TeardownStream.php•IM A AutomationIM AiRenorts> D AudioMAutomatedRenorts(C) RequestGenerateAck.lil© RequestGenerateRepo© SendReportExpiringSoC) SendReport.loh nhn© SendReportMailJob.phc senakeponinorcenera• C Calendaraermv 0 Deletec) DeleteAccountJob.c) DeleteContactJob.rw Deletecrmentitvurac) Deletelead.oo.oho© DeleteOpportunityC) VerifvActivitvCrmirv a Hubsoot> TraitsC) FetchMeraedObiecC) Hubsnot AonUninst@ ImnortAccountRatoN. ImnortRatch.lohTraC) ImnortContactRateC) Imnort@nnortunitvf# ProcessHubsnotWeC) ProceccinternalWelC DrococcMornedobie DrococeWohhookse) lindataDonlWohha) M CalocforcdtrySuser = Sactivitv->aetUser@:SpersistedAttendees = $this->collectParticipants(Sactivity):i€ Cemntv(SnensistedAttendeps))₫Slogger->info('[ConferenceCrmMatcherJob] No valid participants to process', [=> $this->activityId,ScrmService = ScrmResolver->resolveForUser(Suser):SimportParticipants = Sthis->createImportParticipants(Sactivity. Suser. SpersistedAttendees):SimportParticipants->setcrmservicescrmservicenSimportParticipants->retreshcrmbataoSloager->info('[ConfernceCrmMatcherJobl Refresh activity erm data finished'. [l'activity id' => sthis-›activitvid.'particivants count' => countSoersistedAttendees).} catch (SocialAccountTokenInvalidException $e) {Sloagen->error('ConferencecrmMatcherJ0b CRM token invalid'.=> Se->aetMessade@i.i// Prevent retries when no social account is available.Sthis->fail(Se):catch Eycontion Col d$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [tactivity idt -s Cthic-sactivitutdl'error' => $e->qetMessage0.'trace' => $e->qetTraceAsStringO.D:tlof2 edits yAccept File &+X Reiect File t8@+ 6 of 7 files →throw SearQube for INE suadections: Netect more cecurity iccuec in vour DHP filec II Try SonarQube Cloud for fres /I Download oarQuhe Sorver |l Iearn more /I Don't ack adain (todav 10-25)© ProviderRateLimiter.php X = custom.logElaravel.log4 SF jiminny@localhost]A HS_local [jiminny@localhost]tiò accounts fürA console (PROD]# console [eu)A console [STAGING]use...class Providerratelimitenorotected RateLimiter SrateLimiter:public function __construct(RateLimiter $rateLimiter)(...}public function canMakeRequest(RateLimited $provider): bool/** Ovar RateLimitInterface SrateLimit */foreach (Sprovider->getRateLimits as $rateLimit) ‹$key = SrateLimit->getKeyO:if (Sthis->rateLimiter->tooManyAttempts($key, SrateLimit->getQuotaO)) ‹return true:pubLic tunction requestavallableln kateLimited Sprovider : 1ntreturn Sprovider->getRateLimits(->isNotEmotv@Sprovider->getRateLimitso(RateLimitInterface SrateLimit): int => Sthis->rateLimiter->availableIn(SrateLir->maxonublic function incrementRequestCountRateLimited Sorovider)• void** Avan Ratel imitIntenface Sratel imit *^foreach (Sprovider->getRateLimits as $rateLimit){Sthicesnasmit-›getKey, $rateLimit->getWindow0):TO lo100% 12Thu 7 May 21:15:02U AskJiminnyReportActivityServiceTest vCascadeHubspot Rate Limiting• Hubspot Rate Limit+0 ..ContinueCommand cd, areo, headop /yoer /bxev/nint 1 grep -t Trst Th iC -ActivityServie\|craActavityService" -nc luderi x- phpuSKipwA You've used 93% of your quota. Quota resets May 8, 11:00 AM GMT+3.app/Jobs/Crm/ MatchActivityCrmData.php +6app/Jobs/Activity/ ConferenceCrmMatcherJob.php +6aoo/lobs/Crm/l#SvncHubspotObiects.ohv +6oort/@ HydrateCrmDataByExternalCallid.Job.oho +6app/Jobs/Middleware/ HandleHubspotRateLimit.php +44onntlshelCrm/ß CunaOnnartunitineloh.nhnrdlAsk anvthina (84L)C° AdantiveView al•Reiect alllAccent alli• oW Windsurf Teams 1:1 UTF-8 P 4 spaces...
|
NULL
|
-8903636769225120449
|
NULL
|
click
|
ocr
|
NULL
|
PhostormINavigarecodeProiect v© DetachActivityObje PhostormINavigarecodeProiect v© DetachActivityObject.php© ActivityChangeCatego© SyncOpportunitiesJob.php• Cllentonp©Assignownersnip.ongC DelereAcuivities.onpC Delete leamenurnDatac) Delele l eamskerention© HardDeleteActivities.pc) Hubspot/Service.phpC) PayloadBuilder.php(c) CrmActivityService.phoC) CachedCrmServiceDecorator.pho© HardDeleteActivity.pnj ( Hubspot/.../SyncCrmEntitiesTrait.php© MatchMeetingOwner.r© Pipedrive/Service.phpServicelntertace.php© OpportunitySyncTest.phpclass ConferencecrmMatcherJob imolements Shou doueueC) ReindexForAccountJoloublic function handledC) ReindexForcontactJoiC) ReindexForgroupJob.r© ReindexForUser.Job.phC) RetrvActivitvSvnc.lob.n@ SvncActivity.php© TeardownStream.php•IM A AutomationIM AiRenorts> D AudioMAutomatedRenorts(C) RequestGenerateAck.lil© RequestGenerateRepo© SendReportExpiringSoC) SendReport.loh nhn© SendReportMailJob.phc senakeponinorcenera• C Calendaraermv 0 Deletec) DeleteAccountJob.c) DeleteContactJob.rw Deletecrmentitvurac) Deletelead.oo.oho© DeleteOpportunityC) VerifvActivitvCrmirv a Hubsoot> TraitsC) FetchMeraedObiecC) Hubsnot AonUninst@ ImnortAccountRatoN. ImnortRatch.lohTraC) ImnortContactRateC) Imnort@nnortunitvf# ProcessHubsnotWeC) ProceccinternalWelC DrococcMornedobie DrococeWohhookse) lindataDonlWohha) M CalocforcdtrySuser = Sactivitv->aetUser@:SpersistedAttendees = $this->collectParticipants(Sactivity):i€ Cemntv(SnensistedAttendeps))₫Slogger->info('[ConferenceCrmMatcherJob] No valid participants to process', [=> $this->activityId,ScrmService = ScrmResolver->resolveForUser(Suser):SimportParticipants = Sthis->createImportParticipants(Sactivity. Suser. SpersistedAttendees):SimportParticipants->setcrmservicescrmservicenSimportParticipants->retreshcrmbataoSloager->info('[ConfernceCrmMatcherJobl Refresh activity erm data finished'. [l'activity id' => sthis-›activitvid.'particivants count' => countSoersistedAttendees).} catch (SocialAccountTokenInvalidException $e) {Sloagen->error('ConferencecrmMatcherJ0b CRM token invalid'.=> Se->aetMessade@i.i// Prevent retries when no social account is available.Sthis->fail(Se):catch Eycontion Col d$logger->error('[ConferenceCrmMatcherJob] Failed to refresh activity crm data', [tactivity idt -s Cthic-sactivitutdl'error' => $e->qetMessage0.'trace' => $e->qetTraceAsStringO.D:tlof2 edits yAccept File &+X Reiect File t8@+ 6 of 7 files →throw SearQube for INE suadections: Netect more cecurity iccuec in vour DHP filec II Try SonarQube Cloud for fres /I Download oarQuhe Sorver |l Iearn more /I Don't ack adain (todav 10-25)© ProviderRateLimiter.php X = custom.logElaravel.log4 SF jiminny@localhost]A HS_local [jiminny@localhost]tiò accounts fürA console (PROD]# console [eu)A console [STAGING]use...class Providerratelimitenorotected RateLimiter SrateLimiter:public function __construct(RateLimiter $rateLimiter)(...}public function canMakeRequest(RateLimited $provider): bool/** Ovar RateLimitInterface SrateLimit */foreach (Sprovider->getRateLimits as $rateLimit) ‹$key = SrateLimit->getKeyO:if (Sthis->rateLimiter->tooManyAttempts($key, SrateLimit->getQuotaO)) ‹return true:pubLic tunction requestavallableln kateLimited Sprovider : 1ntreturn Sprovider->getRateLimits(->isNotEmotv@Sprovider->getRateLimitso(RateLimitInterface SrateLimit): int => Sthis->rateLimiter->availableIn(SrateLir->maxonublic function incrementRequestCountRateLimited Sorovider)• void** Avan Ratel imitIntenface Sratel imit *^foreach (Sprovider->getRateLimits as $rateLimit){Sthicesnasmit-›getKey, $rateLimit->getWindow0):TO lo100% 12Thu 7 May 21:15:02U AskJiminnyReportActivityServiceTest vCascadeHubspot Rate Limiting• Hubspot Rate Limit+0 ..ContinueCommand cd, areo, headop /yoer /bxev/nint 1 grep -t Trst Th iC -ActivityServie\|craActavityService" -nc luderi x- phpuSKipwA You've used 93% of your quota. Quota resets May 8, 11:00 AM GMT+3.app/Jobs/Crm/ MatchActivityCrmData.php +6app/Jobs/Activity/ ConferenceCrmMatcherJob.php +6aoo/lobs/Crm/l#SvncHubspotObiects.ohv +6oort/@ HydrateCrmDataByExternalCallid.Job.oho +6app/Jobs/Middleware/ HandleHubspotRateLimit.php +44onntlshelCrm/ß CunaOnnartunitineloh.nhnrdlAsk anvthina (84L)C° AdantiveView al•Reiect alllAccent alli• oW Windsurf Teams 1:1 UTF-8 P 4 spaces...
|
6317
|
NULL
|
NULL
|
NULL
|
|
6319
|
263
|
0
|
2026-05-07T18:15:12.508682+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177712508_m1.jpg...
|
PhpStorm
|
faVsco.js – ConferenceCrmMatcherJob.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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());
}
}
}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6322393822977483
|
-2563669779787567664
|
click
|
accessibility
|
NULL
|
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());
}
}
}...
|
6316
|
NULL
|
NULL
|
NULL
|
|
6339
|
NULL
|
0
|
2026-05-07T18:19:45.322807+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177985322_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6913338268963121281
|
-2638885657156940408
|
idle
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
6326
|
NULL
|
NULL
|
NULL
|
|
6340
|
NULL
|
0
|
2026-05-07T18:19:50.079581+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778177990079_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6913338268963121281
|
-2638885657156940408
|
idle
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
6330
|
NULL
|
NULL
|
NULL
|
|
6341
|
265
|
0
|
2026-05-07T18:20:15.725083+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178015725_m1.jpg...
|
PhpStorm
|
faVsco.js – MatchCrmData.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6913338268963121281
|
-2638885657156940408
|
idle
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
6326
|
NULL
|
NULL
|
NULL
|
|
6342
|
266
|
0
|
2026-05-07T18:20:20.580421+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178020580_m2.jpg...
|
PhpStorm
|
faVsco.js – MatchCrmData.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.4401596,"top":0.06624102,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Activity\\Import;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Component\\Utility\\Service\\ProviderRateLimiter;\nuse Jiminny\\Contracts\\Services\\Crm\\ServiceInterface;\nuse Jiminny\\DTO\\ImportCall\\Call;\nuse Jiminny\\Component\\TranscriptionSummary\\Events\\TranscriptionAiSummaryReadyEvent;\nuse Jiminny\\Events\\Activities\\AiAutomation\\ActivityProspectAdded;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Jobs\\Middleware\\HandleHubspotRateLimit;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Models\\Participant;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Services\\Crm\\CrmObjectsResolver;\nuse Jiminny\\Services\\Crm\\ProspectSearchStrategyFactory;\nuse Jiminny\\Services\\Crm\\ProviderRegistry;\nuse Psr\\Log\\LoggerInterface;\n\nclass MatchCrmData implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n\n // AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.\n private const int MAX_DELAY = 43140;\n\n // Infrastructure allows max 3 retries (1 initial execution + 3 retries)\n public int $tries = 4;\n\n private Call $call;\n private int $activityId;\n private Team $team;\n private ServiceInterface $crmService;\n\n private LoggerInterface $logger;\n private array $logContext;\n\n public function middleware(): array\n {\n return [new HandleHubspotRateLimit()];\n }\n\n public function __construct(Call $call, int $activityId)\n {\n $this->call = $call;\n $this->activityId = $activityId;\n\n $this->logContext = [\n 'activity_id' => $activityId,\n 'call_id' => $call->getCallId(),\n 'provider' => $call->getProvider(),\n ];\n\n $this->onQueue(Constants::QUEUE_DIALERS);\n }\n\n public function handle(\n CrmObjectsResolver $crmObjectsResolver,\n ProviderRegistry $providerRegistry,\n ProviderRateLimiter $rateLimiter,\n ActivityRepository $activityRepository,\n LoggerInterface $logger,\n Dispatcher $eventDispatcher,\n ): void {\n $this->logger = $logger;\n\n // Activity is already augmented with CRM data, no need to perform the same operation\n if ($this->call->isActivityUpdatedWithCrm()) {\n $this->logMessage('Skipping activity. Already updated with CRM data');\n\n return;\n }\n\n /** @var Activity $activity */\n $activity = $activityRepository->findById($this->activityId);\n\n try {\n $this->initialiseCrmService($activity, $providerRegistry);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logMessage('Invalid token, retrying');\n $this->release(self::MAX_DELAY); // Try again tomorrow\n\n return;\n }\n\n $prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);\n if ($prospectSearchStrategy->ignoreCrmMatchData()) {\n // Ignore any associated opportunity\n $this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [\n 'activity_id' => $this->activityId,\n 'strategy' => get_class($prospectSearchStrategy),\n ]);\n\n return;\n }\n\n if (! $rateLimiter->canMakeRequest($activity->getCrm())) {\n $this->logMessage('Rate limit reached, retrying');\n $this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));\n\n return;\n }\n\n $this->logMessage('Resolving CRM objects');\n\n $rateLimiter->incrementRequestCount($activity->getCrm());\n $crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);\n\n if (empty($crmObjects)) {\n $this->logMessage('Could not resolve CRM objects, retrying');\n $this->release(3600);\n\n return;\n }\n\n [$lead, $account, $opportunity, $contact, $stage] = $crmObjects;\n\n $activity->update([\n 'lead_id' => $lead->id ?? null,\n 'contact_id' => $contact->id ?? null,\n 'account_id' => $account->id ?? null,\n 'opportunity_id' => $opportunity->id ?? null,\n 'stage_id' => $stage->id ?? null,\n ]);\n\n $activity->refresh();\n\n $eventDispatcher->dispatch(new ActivityProspectAdded(\n activity: $activity,\n eventSource: 'match-crm-data'\n ));\n\n if ($activity->getProspectName() !== null) {\n $activity->setTitleFromCallData($this->call);\n\n /** @var Participant $prospectParticipant */\n $prospectParticipant = $activity\n ->participants()\n ->where(function (Builder $query) use ($activity) {\n $query\n ->whereNull('user_id')\n ->orWhere('user_id', '!=', $activity->getUserId())\n ;\n })\n ->first()\n ;\n\n $activity->updateParticipantCrmData($crmObjects, $prospectParticipant);\n }\n\n $this->logMessage('Activity updated');\n\n $this->triggerSummaryPushIfReady($activity, $eventDispatcher);\n }\n\n private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void\n {\n if (! $activity->hasTranscriptionId()) {\n return;\n }\n\n if ($activity->hasProspectActivitySummaryLog()) {\n $this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');\n\n return;\n }\n\n $this->logMessage('Triggering summary push after CRM matching');\n $eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));\n }\n\n private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void\n {\n $this->team = $activity->getUser()->getTeam();\n $crmProviderName = $this->team->getCrmConfiguration()->getProviderName();\n\n $crmService = $providerRegistry->get($crmProviderName);\n $crmService->setUser($this->team->getOwner());\n $this->crmService = $crmService;\n\n $this->logContext['team'] = $this->team->getSlug();\n $this->logContext['team_id'] = $this->team->getId();\n }\n\n private function logMessage(string $message): void\n {\n $this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6913338268963121281
|
-2638885657156940408
|
idle
|
accessibility
|
NULL
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Activity\Import;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Contracts\Services\Crm\ServiceInterface;
use Jiminny\DTO\ImportCall\Call;
use Jiminny\Component\TranscriptionSummary\Events\TranscriptionAiSummaryReadyEvent;
use Jiminny\Events\Activities\AiAutomation\ActivityProspectAdded;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use Jiminny\Models\Activity;
use Jiminny\Models\Participant;
use Jiminny\Models\Team;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Services\Crm\CrmObjectsResolver;
use Jiminny\Services\Crm\ProspectSearchStrategyFactory;
use Jiminny\Services\Crm\ProviderRegistry;
use Psr\Log\LoggerInterface;
class MatchCrmData implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
// AWS visibility timeout allows a maximum of 12 hours. This is 1 minute less.
private const int MAX_DELAY = 43140;
// Infrastructure allows max 3 retries (1 initial execution + 3 retries)
public int $tries = 4;
private Call $call;
private int $activityId;
private Team $team;
private ServiceInterface $crmService;
private LoggerInterface $logger;
private array $logContext;
public function middleware(): array
{
return [new HandleHubspotRateLimit()];
}
public function __construct(Call $call, int $activityId)
{
$this->call = $call;
$this->activityId = $activityId;
$this->logContext = [
'activity_id' => $activityId,
'call_id' => $call->getCallId(),
'provider' => $call->getProvider(),
];
$this->onQueue(Constants::QUEUE_DIALERS);
}
public function handle(
CrmObjectsResolver $crmObjectsResolver,
ProviderRegistry $providerRegistry,
ProviderRateLimiter $rateLimiter,
ActivityRepository $activityRepository,
LoggerInterface $logger,
Dispatcher $eventDispatcher,
): void {
$this->logger = $logger;
// Activity is already augmented with CRM data, no need to perform the same operation
if ($this->call->isActivityUpdatedWithCrm()) {
$this->logMessage('Skipping activity. Already updated with CRM data');
return;
}
/** @var Activity $activity */
$activity = $activityRepository->findById($this->activityId);
try {
$this->initialiseCrmService($activity, $providerRegistry);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logMessage('Invalid token, retrying');
$this->release(self::MAX_DELAY); // Try again tomorrow
return;
}
$prospectSearchStrategy = ProspectSearchStrategyFactory::match($this->team);
if ($prospectSearchStrategy->ignoreCrmMatchData()) {
// Ignore any associated opportunity
$this->logger->info('[MatchCrmData] Ignoring crm data because of prospect strategy', [
'activity_id' => $this->activityId,
'strategy' => get_class($prospectSearchStrategy),
]);
return;
}
if (! $rateLimiter->canMakeRequest($activity->getCrm())) {
$this->logMessage('Rate limit reached, retrying');
$this->release($rateLimiter->requestAvailableIn($activity->getCrm()) + random_int(1, 60));
return;
}
$this->logMessage('Resolving CRM objects');
$rateLimiter->incrementRequestCount($activity->getCrm());
$crmObjects = $crmObjectsResolver->resolveFromCall($this->crmService, $this->call);
if (empty($crmObjects)) {
$this->logMessage('Could not resolve CRM objects, retrying');
$this->release(3600);
return;
}
[$lead, $account, $opportunity, $contact, $stage] = $crmObjects;
$activity->update([
'lead_id' => $lead->id ?? null,
'contact_id' => $contact->id ?? null,
'account_id' => $account->id ?? null,
'opportunity_id' => $opportunity->id ?? null,
'stage_id' => $stage->id ?? null,
]);
$activity->refresh();
$eventDispatcher->dispatch(new ActivityProspectAdded(
activity: $activity,
eventSource: 'match-crm-data'
));
if ($activity->getProspectName() !== null) {
$activity->setTitleFromCallData($this->call);
/** @var Participant $prospectParticipant */
$prospectParticipant = $activity
->participants()
->where(function (Builder $query) use ($activity) {
$query
->whereNull('user_id')
->orWhere('user_id', '!=', $activity->getUserId())
;
})
->first()
;
$activity->updateParticipantCrmData($crmObjects, $prospectParticipant);
}
$this->logMessage('Activity updated');
$this->triggerSummaryPushIfReady($activity, $eventDispatcher);
}
private function triggerSummaryPushIfReady(Activity $activity, Dispatcher $eventDispatcher): void
{
if (! $activity->hasTranscriptionId()) {
return;
}
if ($activity->hasProspectActivitySummaryLog()) {
$this->logMessage('Summary already sent to prospect, skipping summary push after CRM matching');
return;
}
$this->logMessage('Triggering summary push after CRM matching');
$eventDispatcher->dispatch(new TranscriptionAiSummaryReadyEvent($activity->getUuid()));
}
private function initialiseCrmService(Activity $activity, ProviderRegistry $providerRegistry): void
{
$this->team = $activity->getUser()->getTeam();
$crmProviderName = $this->team->getCrmConfiguration()->getProviderName();
$crmService = $providerRegistry->get($crmProviderName);
$crmService->setUser($this->team->getOwner());
$this->crmService = $crmService;
$this->logContext['team'] = $this->team->getSlug();
$this->logContext['team_id'] = $this->team->getId();
}
private function logMessage(string $message): void
{
$this->logger->info(sprintf('[MatchCrmData] %s', $message), $this->logContext);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
6330
|
NULL
|
NULL
|
NULL
|
|
6357
|
NULL
|
0
|
2026-05-07T18:24:34.475037+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178274475_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6358
|
NULL
|
0
|
2026-05-07T18:24:48.930744+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178288930_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6359
|
268
|
0
|
2026-05-07T18:25:05.006451+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178305006_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6360
|
267
|
0
|
2026-05-07T18:25:19.332752+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178319332_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6377
|
NULL
|
0
|
2026-05-07T18:29:53.219810+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178593219_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6378
|
NULL
|
0
|
2026-05-07T18:29:58.441617+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178598441_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6379
|
269
|
0
|
2026-05-07T18:30:23.599501+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178623599_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6380
|
270
|
0
|
2026-05-07T18:30:28.957884+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178628957_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6397
|
NULL
|
0
|
2026-05-07T18:34:57.226721+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178897226_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6398
|
NULL
|
0
|
2026-05-07T18:35:03.694029+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178903694_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6399
|
271
|
0
|
2026-05-07T18:35:27.624405+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178927624_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6400
|
272
|
0
|
2026-05-07T18:35:34.442+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778178934442_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6413
|
NULL
|
0
|
2026-05-07T18:39:00.490156+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778179140490_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6414
|
NULL
|
0
|
2026-05-07T18:39:07.951871+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778179147951_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteCrmEntityTrait.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8081782,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","depth":4,"bounds":{"left":0.43384308,"top":0.070231445,"width":0.31615692,"height":0.91300875},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\Utility\\Service;\n\nuse Illuminate\\Cache\\RateLimiter;\nuse Jiminny\\Contracts\\Http\\RateLimited;\nuse Jiminny\\Contracts\\Http\\RateLimitInterface;\n\nclass ProviderRateLimiter\n{\n protected RateLimiter $rateLimiter;\n\n public function __construct(RateLimiter $rateLimiter)\n {\n $this->rateLimiter = $rateLimiter;\n }\n\n public function canMakeRequest(RateLimited $provider): bool\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $key = $rateLimit->getKey();\n\n if ($this->rateLimiter->tooManyAttempts($key, $rateLimit->getQuota())) {\n return false;\n }\n }\n\n return true;\n }\n\n public function requestAvailableIn(RateLimited $provider): int\n {\n return $provider->getRateLimits()->isNotEmpty()\n ? $provider->getRateLimits()\n ->map(fn (RateLimitInterface $rateLimit): int => $this->rateLimiter->availableIn($rateLimit->getKey()))\n ->max()\n : 0\n ;\n }\n\n public function incrementRequestCount(RateLimited $provider): void\n {\n /** @var RateLimitInterface $rateLimit */\n foreach ($provider->getRateLimits() as $rateLimit) {\n $this->rateLimiter->hit($rateLimit->getKey(), $rateLimit->getWindow());\n }\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.39694148,"top":0.22426178,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40658244,"top":0.22266561,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.41389626,"top":0.22266561,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Support\\Collection;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Events\\Crm\\DetachActivityObject;\nuse Jiminny\\Models\\Activity;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\ntrait DeleteCrmEntityTrait\n{\n public int $tries = 3;\n\n public function timeout(): int\n {\n return 300; // 5 minutes\n }\n\n public function backoff(): array\n {\n return [30, 90, 180]; // 30 seconds, 1.5 minutes, 3 minutes\n }\n\n protected function handleActivities(\n Collection $activities,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n bool $emitEvent = true,\n ): void {\n if ($activities->isEmpty()) {\n return;\n }\n\n $crmObject = $this->getEntityType();\n $entityIdField = $crmObject->value . '_id';\n\n $activities->each(\n function (Activity $activity) use ($dispatcher, $logger, $entityIdField, $crmObject, $emitEvent): void {\n $stageId = $activity->getStage()?->getId();\n\n $logData = [\n $crmObject->value => $this->id,\n 'activity' => $activity->getId(),\n 'emitEvent' => $emitEvent,\n ];\n\n $updateData = [\n $entityIdField => null,\n ];\n\n // For leads and opportunities, also nullify the stage_id\n if ($stageId && in_array($crmObject, [CrmObject::LEAD, CrmObject::OPPORTUNITY], true)) {\n $updateData['stage_id'] = null;\n $logData['stage_id'] = $stageId;\n }\n\n $activity->update($updateData);\n\n if ($emitEvent) {\n $dispatcher->dispatch(new DetachActivityObject($activity, $crmObject));\n }\n\n $logger->info($this->getLogPrefix() . ' Detach from activity', $logData);\n\n // Dispatch job to verify if CRM task/event still exists\n if ($activity->hasCrmProviderId()) {\n VerifyActivityCrmTaskJob::dispatch($activity->getId());\n }\n }\n );\n }\n\n public function failed(Throwable $exception): void\n {\n $crmObject = $this->getEntityType();\n\n Log::critical($this->getLogPrefix() . ' Job failed permanently', [\n $crmObject->value => $this->id,\n 'exception' => $exception->getMessage(),\n ]);\n }\n\n // Abstract methods that must be implemented by the using class\n abstract protected function getLogPrefix(): string;\n abstract protected function getEntityType(): CrmObject;\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5795911359130326036
|
-3723267450049791664
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6415
|
NULL
|
0
|
2026-05-07T18:50:34.495265+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778179834495_m1.jpg...
|
iTerm2
|
-zsh
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXTextArea","text [{"role":"AXTextArea","text":"Last login: Thu May 7 09:45:09 on ttys010\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe \nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll\ntotal 667416\ndrwxr-xr-x 11 lukas staff 352 7 May 13:40 .\ndrwx------+ 93 lukas staff 2976 7 May 13:40 ..\ndrwxr-xr-x 18 lukas staff 576 6 May 20:31 data\n-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite\n-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm\n-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal\ndrwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes\n-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log\n-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log\n-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh\n-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe \n449M\u0000\u0000\u0000\t/Users/lukas/.screenpipe\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $","depth":4,"bounds":{"left":0.0,"top":0.08777778,"width":1.0,"height":0.9122222},"on_screen":true,"lines":[{"char_start":0,"char_count":43,"bounds":{"left":0.0034722222,"top":0.08777778,"width":0.23888889,"height":0.02}},{"char_start":43,"char_count":1,"bounds":{"left":0.0034722222,"top":0.107777774,"width":0.0055555557,"height":0.02}},{"char_start":44,"char_count":75,"bounds":{"left":0.0034722222,"top":0.12777779,"width":0.41666666,"height":0.02}},{"char_start":119,"char_count":1,"bounds":{"left":0.0034722222,"top":0.14777778,"width":0.0055555557,"height":0.02}},{"char_start":120,"char_count":75,"bounds":{"left":0.0034722222,"top":0.16777778,"width":0.41666666,"height":0.02}},{"char_start":195,"char_count":63,"bounds":{"left":0.0034722222,"top":0.18777777,"width":0.35,"height":0.02}},{"char_start":258,"char_count":60,"bounds":{"left":0.0034722222,"top":0.20777778,"width":0.33333334,"height":0.02}},{"char_start":318,"char_count":13,"bounds":{"left":0.0034722222,"top":0.22777778,"width":0.072222225,"height":0.02}},{"char_start":331,"char_count":54,"bounds":{"left":0.0034722222,"top":0.24777777,"width":0.3,"height":0.02}},{"char_start":385,"char_count":55,"bounds":{"left":0.0034722222,"top":0.26777777,"width":0.30555555,"height":0.02}},{"char_start":440,"char_count":57,"bounds":{"left":0.0034722222,"top":0.28777778,"width":0.31666666,"height":0.02}},{"char_start":497,"char_count":62,"bounds":{"left":0.0034722222,"top":0.3077778,"width":0.34444445,"height":0.02}},{"char_start":559,"char_count":66,"bounds":{"left":0.0034722222,"top":0.32777777,"width":0.36666667,"height":0.02}},{"char_start":625,"char_count":66,"bounds":{"left":0.0034722222,"top":0.34777778,"width":0.36666667,"height":0.02}},{"char_start":691,"char_count":58,"bounds":{"left":0.0034722222,"top":0.36777776,"width":0.32222223,"height":0.02}},{"char_start":749,"char_count":80,"bounds":{"left":0.0034722222,"top":0.38777778,"width":0.44444445,"height":0.02}},{"char_start":829,"char_count":80,"bounds":{"left":0.0034722222,"top":0.4077778,"width":0.44444445,"height":0.02}},{"char_start":909,"char_count":71,"bounds":{"left":0.0034722222,"top":0.42777777,"width":0.39444444,"height":0.02}},{"char_start":980,"char_count":61,"bounds":{"left":0.0034722222,"top":0.44777778,"width":0.33888888,"height":0.02}},{"char_start":1041,"char_count":79,"bounds":{"left":0.0034722222,"top":0.4677778,"width":0.43888888,"height":0.02}},{"char_start":1120,"char_count":33,"bounds":{"left":0.0034722222,"top":0.48777777,"width":0.18333334,"height":0.02}},{"char_start":1153,"char_count":56,"bounds":{"left":0.0034722222,"top":0.50777775,"width":0.31111112,"height":0.02}}],"value":"Last login: Thu May 7 09:45:09 on ttys010\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe \nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll\ntotal 667416\ndrwxr-xr-x 11 lukas staff 352 7 May 13:40 .\ndrwx------+ 93 lukas staff 2976 7 May 13:40 ..\ndrwxr-xr-x 18 lukas staff 576 6 May 20:31 data\n-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite\n-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm\n-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal\ndrwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes\n-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log\n-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log\n-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh\n-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe \n449M\u0000\u0000\u0000\t/Users/lukas/.screenpipe\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $","is_focused":true},{"role":"AXRadioButton","text":"DOCKER","depth":2,"bounds":{"left":0.0,"top":0.05888889,"width":0.16458334,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.004166667,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"DEV (-zsh)","depth":2,"bounds":{"left":0.16458334,"top":0.05888889,"width":0.16458334,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.16875,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"APP (-zsh)","depth":2,"bounds":{"left":0.32916668,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.33333334,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.49340278,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.49756944,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe\"","depth":2,"bounds":{"left":0.6576389,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.66180557,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.821875,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.82604164,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌥⌘1","depth":1,"bounds":{"left":0.95763886,"top":0.032222223,"width":0.03888889,"height":0.018888889},"on_screen":true,"automation_id":"_NS:8","role_description":"text"},{"role":"AXStaticText","text":"-zsh","depth":1,"bounds":{"left":0.48958334,"top":0.033333335,"width":0.022916667,"height":0.017777778},"on_screen":true,"role_description":"text"}]...
|
-1110953375923320627
|
5730441446552296595
|
idle
|
accessibility
|
NULL
|
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...
|
6354
|
NULL
|
NULL
|
NULL
|
|
6416
|
NULL
|
0
|
2026-05-07T18:50:34.502235+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-07/1778 /Users/lukas/.screenpipe/data/data/2026-05-07/1778179834502_m2.jpg...
|
iTerm2
|
-zsh
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXTextArea","text [{"role":"AXTextArea","text":"Last login: Thu May 7 09:45:09 on ttys010\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe \nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll\ntotal 667416\ndrwxr-xr-x 11 lukas staff 352 7 May 13:40 .\ndrwx------+ 93 lukas staff 2976 7 May 13:40 ..\ndrwxr-xr-x 18 lukas staff 576 6 May 20:31 data\n-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite\n-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm\n-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal\ndrwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes\n-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log\n-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log\n-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh\n-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe \n449M\u0000\u0000\u0000\t/Users/lukas/.screenpipe\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.4800532,"height":-0.06304872},"on_screen":true,"value":"Last login: Thu May 7 09:45:09 on ttys010\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\n\nPoetry could not find a pyproject.toml file in /Users/lukas or its parents\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ cd ~/.screenpipe \nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ ll\ntotal 667416\ndrwxr-xr-x 11 lukas staff 352 7 May 13:40 .\ndrwx------+ 93 lukas staff 2976 7 May 13:40 ..\ndrwxr-xr-x 18 lukas staff 576 6 May 20:31 data\n-rw-r--r-- 1 lukas staff 336154624 7 May 13:40 db.sqlite\n-rw-r--r-- 1 lukas staff 65536 7 May 10:42 db.sqlite-shm\n-rw-r--r-- 1 lukas staff 4408432 7 May 13:40 db.sqlite-wal\ndrwxr-xr-x 8 lukas staff 256 6 May 20:27 pipes\n-rw-r--r-- 1 lukas staff 28408 6 May 21:02 screenpipe.2026-05-06.0.log\n-rw-r--r-- 1 lukas staff 159469 7 May 13:40 screenpipe.2026-05-07.0.log\n-rwxr-xr-x 1 lukas staff 14994 6 May 20:26 screenpipe_sync.sh\n-rw-r--r-- 1 lukas staff 3167 7 May 09:23 sync.log\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $ du -sh ~/.screenpipe \n449M\u0000\u0000\u0000\t/Users/lukas/.screenpipe\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/.screenpipe $","is_focused":true},{"role":"AXRadioButton","text":"DOCKER","depth":2,"bounds":{"left":0.27027926,"top":1.0,"width":0.0787899,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.27227393,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"DEV (-zsh)","depth":2,"bounds":{"left":0.34906915,"top":1.0,"width":0.0787899,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.35106382,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"APP (-zsh)","depth":2,"bounds":{"left":0.42785904,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.42985374,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.5064827,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.5084774,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe\"","depth":2,"bounds":{"left":0.5851064,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.58710104,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.66373,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.66572475,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌥⌘1","depth":1,"bounds":{"left":0.7287234,"top":1.0,"width":0.01861702,"height":-0.023144484},"on_screen":true,"automation_id":"_NS:8","role_description":"text"},{"role":"AXStaticText","text":"-zsh","depth":1,"bounds":{"left":0.5046542,"top":1.0,"width":0.010970744,"height":-0.02394259},"on_screen":true,"role_description":"text"}]...
|
-1110953375923320627
|
5730441446552296595
|
idle
|
accessibility
|
NULL
|
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...
|
6353
|
NULL
|
NULL
|
NULL
|
|
6417
|
275
|
0
|
2026-05-08T06:25:46.812924+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-08/1778 /Users/lukas/.screenpipe/data/data/2026-05-08/1778221546812_m1.jpg...
|
iTerm2
|
screenpipe"
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXTextArea","text [{"role":"AXTextArea","text":"2026-05-07T18:54:06.694530Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted\n2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted\n2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted\n2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted\n2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames\n2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted\n2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted\n2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames\n2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted\n2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames\n2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted\n2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 27 eligible frames\n2026-05-07T19:23:59.596007Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.1x), 11 JPEGs deleted\n2026-05-07T19:24:00.891142Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 1.1MB (2.5x), 14 JPEGs deleted\n2026-05-07T19:24:36.746388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:24:42.261437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:14.335824Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:14.501546Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:18.608719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:21.337705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:21.444990Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:25:24.322060Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:24.497521Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.631670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.804593Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:48.848098Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:49.055257Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:50.343378Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:53.219355Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:57.486035Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:00.350562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:02.998552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:29:00.996820Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:29:01.829394Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:29:02.677714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:29:02.873130Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.6MB → 0.3MB (4.7x), 9 JPEGs deleted\n2026-05-07T19:29:04.454985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:33:45.474083Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:33:45.574703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:34:02.929639Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:34:03.929929Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:34:04.831248Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.5MB (3.5x), 9 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:35:53.066715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:53.134063Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.399034Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.529875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.116160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.346393Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:39:04.860519Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T19:39:05.856910Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.6MB → 0.4MB (6.7x), 12 JPEGs deleted\n2026-05-07T19:39:06.909595Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 0.7MB (3.7x), 14 JPEGs deleted\n2026-05-07T19:39:19.953400Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:39:20.056731Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:40:34.494177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:34.675208Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.270708Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.967552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:41.599046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:57.136251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.523231Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.647589Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.724759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.787705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.434115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.616452Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.527243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.698300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:14.547340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.343528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.590418Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.346968Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.515629Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.757356Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.887041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.509177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.588640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.303139Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.505341Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.522144Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.601138Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.452115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.613905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.532340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.604673Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.497340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.566719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.315300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.403707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.430309Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.652868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.261495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.329694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.033847Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.279174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:09.130409Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:10.760517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:10.955209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.694453Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.847513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:15.192740Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:19.512956Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:19.695051Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:21.240226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:23.249772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:23.420761Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.101390Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.267234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.661670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.974606Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.693430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.863787Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:43:06.877261Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:43:28.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:44:06.929510Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:44:07.972581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.1x), 9 JPEGs deleted\n2026-05-07T19:44:08.724886Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.3MB (5.5x), 9 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:46:32.604506Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.686719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.765553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:47:31.466526Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:31.528038Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.868347Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.952982Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.140388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.259157Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.653972Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.850397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.635498Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.917036Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.894122Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.983751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.565025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.841375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.389694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.487473Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:25.687327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:26.039544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.217166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.286508Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:34.275736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:48:52.975250Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.011047Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.138297Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.709233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.971474Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:57.903354Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:58.031638Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:08.831271Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T19:49:09.701210Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T19:49:09.988170Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.072461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.622231Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.4MB (4.6x), 10 JPEGs deleted\n2026-05-07T19:49:10.951952Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:11.179405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.213406Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.306678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.434554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.586646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.160394Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.333248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.653111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.788775Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.757003Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.850289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:09.824461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:51:43.978817Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.289204Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.534513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:55.912398Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:07.427464Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:09.914610Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:52:13.999305Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:53:08.137188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3408391724781151, trigger=click)\n2026-05-07T19:53:27.421048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:30.806727Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:55.298484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.229266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.570998Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:10.661598Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T19:54:11.829433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.5MB (5.9x), 13 JPEGs deleted\n2026-05-07T19:54:12.906285Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n2026-05-07T19:54:15.030478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:59:12.939770Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T19:59:14.064266Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.8MB (2.8x), 11 JPEGs deleted\n2026-05-07T19:59:15.028689Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.7MB (2.7x), 10 JPEGs deleted\n2026-05-07T19:59:19.676527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:20.298073Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:59:21.048802Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:47.204531Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:47.386007Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:49.129611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T19:59:57.544434Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:06.938913Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:07.019843Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:17.416687Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:17.621334Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.202076Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.302504Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.987921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:23.300585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:00:45.503937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:45.692395Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:02.738618Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:02:10.601351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:16.908580Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:17.153655Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:33.165320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:33.357830Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.707461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.880760Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:35.941695Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.002767Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.694797Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:39.767667Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:40.243974Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:40.447707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.474533Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.641646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.241150Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.344303Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.427245Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.673424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.360985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.438210Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:04:15.122581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 67 eligible frames\n2026-05-07T20:04:17.266857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 31 frames, 6.8MB → 0.4MB (16.5x), 31 JPEGs deleted\n2026-05-07T20:04:19.692224Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 34 frames, 6.6MB → 1.8MB (3.7x), 34 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:09:19.730149Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T20:09:20.868870Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.0x), 10 JPEGs deleted\n2026-05-07T20:09:21.872731Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.5MB (4.5x), 12 JPEGs deleted\n2026-05-07T20:10:22.481288Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:10:22.724929Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:10:33.403069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:16.881525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:17.206290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:25.414806Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:26.342065Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:12:00.633251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:12:00.764751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:14:21.899602Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T20:14:22.842168Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.5MB (4.6x), 11 JPEGs deleted\n2026-05-07T20:14:23.833238Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.8MB → 0.7MB (2.6x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:16:16.015969Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:16.262718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.386104Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.594387Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.837266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.988598Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.290499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.550857Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:18:22.484670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:19:23.913857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:19:24.908787Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:19:25.659631Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.6MB → 0.2MB (6.7x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:22:08.888954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:22:09.031478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:23:15.387842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:21.333524Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:25.728554Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T20:24:27.036433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:24:28.328187Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.3MB (3.9x), 8 JPEGs deleted\n2026-05-07T20:24:37.328678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:43.353544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:24:55.872936Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:58.540875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:25:35.867578Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:26:42.340931Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:13.971772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:16.626054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T20:29:18.382762Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.388168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.470946Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:28.365413Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 19 eligible frames\n2026-05-07T20:29:29.189708Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.2x), 9 JPEGs deleted\n2026-05-07T20:29:29.981681Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.4MB (3.6x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:30:27.218155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-145836613520700435, trigger=visual_change)\n2026-05-07T20:30:33.315754Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:33.648193Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n2026-05-07T20:30:36.262915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:54.441609Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:31:08.468287Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:08.761735Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.476804Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.743553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:21.987184Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:22.172149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.558168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.698858Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:31.444495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:31:34.876401Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:34.956738Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.136853Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.238905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.595439Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.965131Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.293555Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.374867Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.450792Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.657577Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.195028Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.394977Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:29.710963Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:29.885984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:45.920243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:33:06.673430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:34:29.989171Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T20:34:30.879482Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T20:34:31.909326Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.2MB → 0.5MB (4.6x), 13 JPEGs deleted\n2026-05-07T20:35:12.105375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:12.236548Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:35:26.184503Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:26.248722Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:26.954900Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:27.559499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:38.156973Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=visual_change)\n2026-05-07T20:36:47.814748Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:47.970282Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.338177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.459862Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:53.207924Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:37:08.617136Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.552854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.715161Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.450415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.568870Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:15.893763Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:16.129140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:37.989437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:38.224177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.686576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.774090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.769203Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.874600Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.392921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.578182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.161501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.405550Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.676454Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.752090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:38:25.338967Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:39:31.941232Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 30 eligible frames\n2026-05-07T20:39:33.328005Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.5MB → 0.7MB (3.5x), 12 JPEGs deleted\n2026-05-07T20:39:35.006471Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 16 frames, 3.0MB → 1.2MB (2.4x), 16 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:40:39.180298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:39.383232Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:40.832153Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=visual_change)\n2026-05-07T20:40:53.463842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6322393822977483, trigger=click)\n2026-05-07T20:40:53.767986Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:44:35.042198Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:44:35.901229Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T20:44:37.057277Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:47:14.469565Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:47:14.659492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:49:37.082051Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 51 eligible frames\n2026-05-07T20:49:38.725072Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 21 frames, 4.6MB → 0.5MB (9.3x), 21 JPEGs deleted\n2026-05-07T20:49:41.540139Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 28 frames, 5.1MB → 2.2MB (2.4x), 28 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:54:41.579472Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:54:42.613188Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.0x), 9 JPEGs deleted\n2026-05-07T20:54:43.513502Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.5MB (4.1x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:58:07.310317Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:07.435000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:08.835660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:09.276486Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:59:43.595276Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:59:44.636647Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T20:59:45.590852Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.2x), 10 JPEGs deleted\n2026-05-07T21:00:16.436168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:00:48.741587Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:00:55.766541Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:01.987730Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:19.657174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:04:45.665545Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T21:04:46.555243Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T21:04:47.505518Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.1MB → 0.3MB (6.3x), 11 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:07:59.390425Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:02.049042Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:58.406336Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:08:58.638209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:09:33.105308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:09:47.541287Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T21:09:48.491343Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:09:49.574479Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.8MB → 0.4MB (4.4x), 9 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:11:18.711785Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:11:43.731627Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:11:58.569054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:14:49.597611Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 29 eligible frames\n2026-05-07T21:14:50.698785Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (8.0x), 14 JPEGs deleted\n2026-05-07T21:14:53.637486Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.5MB → 0.6MB (4.4x), 13 JPEGs deleted\n2026-05-07T21:15:02.521080Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:15:56.220866Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:16:19.271233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:17:24.638614Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:30.785805Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:33.819916Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:40.291660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:44.647424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:44.850725Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:46.523321Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:49.556444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:19:53.705827Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 42 eligible frames\n2026-05-07T21:19:55.056907Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.6MB → 0.9MB (4.0x), 20 JPEGs deleted\n2026-05-07T21:19:56.759790Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.9MB → 1.1MB (3.4x), 20 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:20:29.459260Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:41.532773Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:57.170225Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.150037Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.320528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:27.422746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:22:21.936188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:22.033584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:50.292905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.735984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.914206Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.420221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.695513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:28.410976Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:36.882207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:37.074891Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.366576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.495008Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:49.547721Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:01.423031Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:04.466413Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:56.787200Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T21:24:57.817202Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (7.7x), 14 JPEGs deleted\n2026-05-07T21:24:59.081061Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.7MB (3.3x), 12 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:27:02.818198Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:27:05.774711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:28:30.450527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:29:59.102962Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T21:29:59.987011Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:30:01.159682Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.6MB → 0.9MB (2.7x), 13 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:35:01.331399Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T21:35:02.457282Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.4x), 10 JPEGs deleted\n2026-05-07T21:35:03.532280Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.8MB (2.1x), 8 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:39:18.435385Z INFO screenpipe_engine::sleep_monitor: Screen locked (CGSession safety-net poll)\n2026-05-07T21:39:34.938546Z INFO sck_rs::stream_manager: recreating stream for display 2 (resolution change)\n2026-05-07T21:40:03.554507Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:40:04.411131Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T21:40:05.319315Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.6MB (3.5x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:45:05.336676Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:45:06.184141Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (6.0x), 10 JPEGs deleted\n2026-05-07T21:45:06.960114Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.3MB (6.4x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:50:06.992344Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 18 eligible frames\n2026-05-07T21:50:07.821021Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.7MB → 0.4MB (4.6x), 8 JPEGs deleted\n2026-05-07T21:50:08.563068Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.3MB (5.1x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:50:34.305285Z WARN sqlx::query: summary=\"SELECT DISTINCT app_name, window_name, …\" db.statement=\"\\n\\nSELECT\\n DISTINCT app_name,\\n window_name,\\n browser_url\\nFROM\\n frames\\nWHERE\\n timestamp > datetime('now', '-30 seconds')\\n AND app_name IS NOT NULL\\n AND window_name IS NOT NULL\\n\" rows_affected=0 rows_returned=182 elapsed=1.9089s\n2026-05-07T21:50:34.470706Z INFO screenpipe_engine::sleep_monitor: Screen unlocked (CGSession safety-net poll)\n2026-05-07T21:50:34.479630Z INFO screenpipe_engine::event_driven_capture: invalidating persistent streams after unlock/wake for monitor 1\n2026-05-07T21:50:34.495040Z INFO sck_rs::stream_manager: stopped 1 persistent stream(s)\n2026-05-07T21:50:36.741433Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-07T21:50:37.714776Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)\nzsh: terminated npx screenpipe@latest record --disable-audio --ignored-windows \"Boosteroid\"\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sp-start\ndetected hardware tier: Mid\nwarning: parakeet is not supported on this platform, using whisper-tiny instead\n2026-05-08T09:25:44.404966Z INFO screenpipe_engine::auth_key: api auth: key resolved via secret store\nchecking permissions...\n screen recording: ok\n accessibility: ok\n2026-05-08T09:25:44.477216Z INFO screenpipe_screen::monitor::macos_version: Detected macOS version: 14.6\n2026-05-08T09:25:45.851716Z INFO screenpipe_engine::sleep_monitor: Starting macOS sleep/wake monitor\n2026-05-08T09:25:45.853302Z INFO screenpipe_engine::sleep_monitor: Screen lock/unlock observers registered (CFNotificationCenter)\n2026-05-08T09:25:45.853909Z INFO screenpipe_engine::sleep_monitor: Display reconfiguration watcher registered (CGDisplayRegisterReconfigurationCallback)\n2026-05-08T09:25:45.874540Z INFO screenpipe_engine::permission_monitor: permission monitor started screen=true mic=true accessibility=true keychain=true\n2026-05-08T09:25:45.874606Z INFO screenpipe: meeting detector enabled — independent of transcription mode\n2026-05-08T09:25:45.874891Z INFO screenpipe: API server listening on 127.0.0.1:3030 (localhost only)\n2026-05-08T09:25:45.874915Z INFO screenpipe: API auth enabled — run `screenpipe auth token` to view your key\n2026-05-08T09:25:45.874789Z INFO screenpipe_engine::power::manager: power manager started (poll interval: 10s)\n2026-05-08T09:25:45.874931Z INFO screenpipe_engine::vision_manager::manager: Starting VisionManager\n2026-05-08T09:25:45.874854Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction worker started (min_age=600s, poll=300s)\n2026-05-08T09:25:45.877906Z INFO screenpipe_core::pipes: loaded pipe: day-recap\n2026-05-08T09:25:45.878202Z INFO screenpipe_core::pipes: loaded pipe: standup-update\n2026-05-08T09:25:45.878737Z INFO screenpipe_core::pipes: loaded pipe: ai-habits\n2026-05-08T09:25:45.878843Z INFO screenpipe_core::pipes: loaded pipe: time-breakdown\n2026-05-08T09:25:45.878921Z INFO screenpipe_core::pipes: loaded pipe: video-export\n2026-05-08T09:25:45.878997Z INFO screenpipe_core::pipes: loaded pipe: meeting-summary\n2026-05-08T09:25:45.879015Z INFO screenpipe_core::pipes: loaded 6 pipes from \"/Users/lukas/.screenpipe/pipes\"\n\n\n\n _ \n __________________ ___ ____ ____ (_____ ___ \n / ___/ ___/ ___/ _ \\/ _ \\/ __ \\ / __ \\/ / __ \\/ _ \\\n (__ / /__/ / / __/ __/ / / / / /_/ / / /_/ / __/\n/____/\\___/_/ \\___/\\___/_/ /_/ / .___/_/ .___/\\___/ \n /_/ /_/ \n\n\n\npower AI by everything you've seen, said or heard\nopen source | runs locally | developer friendly\n\n\n┌────────────────────────┬────────────────────────────────────┐\n│ setting │ value │\n├────────────────────────┼────────────────────────────────────┤\n│ audio chunk duration │ 30 seconds │\n│ port │ 3030 │\n│ audio disabled │ true │\n│ vision disabled │ false │\n│ pause on DRM content │ false │\n│ audio engine │ Parakeet │\n│ vad engine │ Silero │\n│ data directory │ /Users/lukas/.screenpipe │\n│ debug mode │ false │\n│ telemetry │ true │\n│ use pii removal │ true │\n│ use all monitors │ true │\n2026-05-08T09:25:45.881529Z INFO screenpipe_core::pipes: pipe scheduler started (generation 2)\n│ ignored windows │ [\"Boosteroid\"] │\n│ included windows │ [] │\n│ cloud sync │ disabled │\n│ auto-destruct pid │ 0 │\n│ deepgram key │ not set │\n│ api auth │ enabled │\n│ encrypt secrets │ disabled │\n│ retention days │ 14 │\n│ retention mode │ media-only (keep transcripts) │\n├────────────────────────┼────────────────────────────────────┤\n│ languages │ │\n│ │ all languages │\n├────────────────────────┼────────────────────────────────────┤\n│ monitors │ │\n│ │ id: 1 │\n│ │ id: 2 │\n├────────────────────────┼────────────────────────────────────┤\n│ audio devices │ │\n│ │ disabled │\n└────────────────────────┴────────────────────────────────────┘\nyou are using local processing. all your data stays on your computer.\n\nwarning: telemetry is enabled. only error-level data will be sent.\nto disable, use the --disable-telemetry flag.\n\ncheck latest changes here: https://github.com/screenpipe/screenpipe/releases\n2026-05-08T09:25:45.881961Z INFO screenpipe: starting UI event capture\n2026-05-08T09:25:45.888762Z INFO screenpipe_engine::power::manager: initial power profile: Performance (on_ac=true, battery=Some(100))\n2026-05-08T09:25:45.891286Z WARN screenpipe: pi agent install failed: bun not found — install from https://bun.sh\n2026-05-08T09:25:45.896583Z INFO screenpipe_engine::ui_recorder: Starting UI event capture\n2026-05-08T09:25:45.913159Z INFO screenpipe_engine::ui_recorder: UI recording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca2\n2026-05-08T09:25:45.913483Z INFO screenpipe_engine::calendar_speaker_id: speaker identification: started (user_name=<not set>)\n2026-05-08T09:25:45.913512Z INFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warming from DB (2026-05-07 06:25:45.913511 UTC to 2026-05-08 06:25:45.913511 UTC)\n2026-05-08T09:25:45.914574Z INFO screenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)\n2026-05-08T09:25:45.923208Z INFO screenpipe_engine::server: Server listening on 127.0.0.1:3030\n2026-05-08T09:25:45.927056Z INFO screenpipe_connect::mdns: mdns: advertising screenpipe on port 3030\n2026-05-08T09:25:46.310992Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 1 (1440x900)\n2026-05-08T09:25:46.311039Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.311076Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.472936Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)\n2026-05-08T09:25:46.472968Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)\n2026-05-08T09:25:46.472981Z INFO screenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)\n2026-05-08T09:25:46.472989Z INFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)\n2026-05-08T09:25:46.473017Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 2 (device: monitor_2)\n2026-05-08T09:25:47.579143Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)","depth":4,"on_screen":true,"value":"2026-05-07T18:54:06.694530Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted\n2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted\n2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted\n2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted\n2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames\n2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted\n2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted\n2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames\n2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted\n2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames\n2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted\n2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 27 eligible frames\n2026-05-07T19:23:59.596007Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.1x), 11 JPEGs deleted\n2026-05-07T19:24:00.891142Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 1.1MB (2.5x), 14 JPEGs deleted\n2026-05-07T19:24:36.746388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:24:42.261437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:14.335824Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:14.501546Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:18.608719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:21.337705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:21.444990Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:25:24.322060Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:24.497521Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.631670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.804593Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:48.848098Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:49.055257Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:50.343378Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:53.219355Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:57.486035Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:00.350562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:02.998552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:29:00.996820Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:29:01.829394Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:29:02.677714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:29:02.873130Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.6MB → 0.3MB (4.7x), 9 JPEGs deleted\n2026-05-07T19:29:04.454985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:33:45.474083Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:33:45.574703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:34:02.929639Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:34:03.929929Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:34:04.831248Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.5MB (3.5x), 9 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:35:53.066715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:53.134063Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.399034Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.529875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.116160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.346393Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:39:04.860519Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T19:39:05.856910Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.6MB → 0.4MB (6.7x), 12 JPEGs deleted\n2026-05-07T19:39:06.909595Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 0.7MB (3.7x), 14 JPEGs deleted\n2026-05-07T19:39:19.953400Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:39:20.056731Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:40:34.494177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:34.675208Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.270708Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.967552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:41.599046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:57.136251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.523231Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.647589Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.724759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.787705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.434115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.616452Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.527243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.698300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:14.547340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.343528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.590418Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.346968Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.515629Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.757356Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.887041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.509177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.588640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.303139Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.505341Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.522144Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.601138Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.452115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.613905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.532340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.604673Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.497340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.566719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.315300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.403707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.430309Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.652868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.261495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.329694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.033847Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.279174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:09.130409Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:10.760517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:10.955209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.694453Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.847513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:15.192740Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:19.512956Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:19.695051Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:21.240226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:23.249772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:23.420761Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.101390Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.267234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.661670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.974606Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.693430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.863787Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:43:06.877261Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:43:28.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:44:06.929510Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:44:07.972581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.1x), 9 JPEGs deleted\n2026-05-07T19:44:08.724886Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.3MB (5.5x), 9 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:46:32.604506Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.686719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.765553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:47:31.466526Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:31.528038Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.868347Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.952982Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.140388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.259157Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.653972Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.850397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.635498Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.917036Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.894122Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.983751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.565025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.841375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.389694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.487473Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:25.687327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:26.039544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.217166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.286508Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:34.275736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:48:52.975250Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.011047Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.138297Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.709233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.971474Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:57.903354Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:58.031638Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:08.831271Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T19:49:09.701210Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T19:49:09.988170Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.072461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.622231Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.4MB (4.6x), 10 JPEGs deleted\n2026-05-07T19:49:10.951952Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:11.179405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.213406Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.306678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.434554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.586646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.160394Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.333248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.653111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.788775Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.757003Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.850289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:09.824461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:51:43.978817Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.289204Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.534513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:55.912398Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:07.427464Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:09.914610Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:52:13.999305Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:53:08.137188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3408391724781151, trigger=click)\n2026-05-07T19:53:27.421048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:30.806727Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:55.298484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.229266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.570998Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:10.661598Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T19:54:11.829433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.5MB (5.9x), 13 JPEGs deleted\n2026-05-07T19:54:12.906285Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n2026-05-07T19:54:15.030478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:59:12.939770Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T19:59:14.064266Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.8MB (2.8x), 11 JPEGs deleted\n2026-05-07T19:59:15.028689Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.7MB (2.7x), 10 JPEGs deleted\n2026-05-07T19:59:19.676527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:20.298073Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:59:21.048802Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:47.204531Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:47.386007Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:49.129611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T19:59:57.544434Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:06.938913Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:07.019843Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:17.416687Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:17.621334Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.202076Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.302504Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.987921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:23.300585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:00:45.503937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:45.692395Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:02.738618Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:02:10.601351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:16.908580Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:17.153655Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:33.165320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:33.357830Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.707461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.880760Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:35.941695Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.002767Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.694797Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:39.767667Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:40.243974Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:40.447707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.474533Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.641646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.241150Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.344303Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.427245Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.673424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.360985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.438210Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:04:15.122581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 67 eligible frames\n2026-05-07T20:04:17.266857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 31 frames, 6.8MB → 0.4MB (16.5x), 31 JPEGs deleted\n2026-05-07T20:04:19.692224Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 34 frames, 6.6MB → 1.8MB (3.7x), 34 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:09:19.730149Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T20:09:20.868870Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.0x), 10 JPEGs deleted\n2026-05-07T20:09:21.872731Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.5MB (4.5x), 12 JPEGs deleted\n2026-05-07T20:10:22.481288Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:10:22.724929Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:10:33.403069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:16.881525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:17.206290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:25.414806Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:26.342065Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:12:00.633251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:12:00.764751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:14:21.899602Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T20:14:22.842168Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.5MB (4.6x), 11 JPEGs deleted\n2026-05-07T20:14:23.833238Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.8MB → 0.7MB (2.6x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:16:16.015969Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:16.262718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.386104Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.594387Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.837266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.988598Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.290499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.550857Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:18:22.484670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:19:23.913857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:19:24.908787Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:19:25.659631Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.6MB → 0.2MB (6.7x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:22:08.888954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:22:09.031478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:23:15.387842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:21.333524Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:25.728554Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T20:24:27.036433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:24:28.328187Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.3MB (3.9x), 8 JPEGs deleted\n2026-05-07T20:24:37.328678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:43.353544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:24:55.872936Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:58.540875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:25:35.867578Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:26:42.340931Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:13.971772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:16.626054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T20:29:18.382762Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.388168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.470946Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:28.365413Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 19 eligible frames\n2026-05-07T20:29:29.189708Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.2x), 9 JPEGs deleted\n2026-05-07T20:29:29.981681Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.4MB (3.6x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:30:27.218155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-145836613520700435, trigger=visual_change)\n2026-05-07T20:30:33.315754Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:33.648193Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n2026-05-07T20:30:36.262915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:54.441609Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:31:08.468287Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:08.761735Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.476804Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.743553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:21.987184Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:22.172149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.558168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.698858Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:31.444495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:31:34.876401Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:34.956738Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.136853Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.238905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.595439Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.965131Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.293555Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.374867Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.450792Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.657577Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.195028Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.394977Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:29.710963Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:29.885984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:45.920243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:33:06.673430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:34:29.989171Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T20:34:30.879482Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T20:34:31.909326Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.2MB → 0.5MB (4.6x), 13 JPEGs deleted\n2026-05-07T20:35:12.105375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:12.236548Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:35:26.184503Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:26.248722Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:26.954900Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:27.559499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:38.156973Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=visual_change)\n2026-05-07T20:36:47.814748Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:47.970282Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.338177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.459862Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:53.207924Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:37:08.617136Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.552854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.715161Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.450415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.568870Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:15.893763Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:16.129140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:37.989437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:38.224177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.686576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.774090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.769203Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.874600Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.392921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.578182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.161501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.405550Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.676454Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.752090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:38:25.338967Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:39:31.941232Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 30 eligible frames\n2026-05-07T20:39:33.328005Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.5MB → 0.7MB (3.5x), 12 JPEGs deleted\n2026-05-07T20:39:35.006471Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 16 frames, 3.0MB → 1.2MB (2.4x), 16 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:40:39.180298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:39.383232Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:40.832153Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=visual_change)\n2026-05-07T20:40:53.463842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6322393822977483, trigger=click)\n2026-05-07T20:40:53.767986Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:44:35.042198Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:44:35.901229Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T20:44:37.057277Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:47:14.469565Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:47:14.659492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:49:37.082051Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 51 eligible frames\n2026-05-07T20:49:38.725072Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 21 frames, 4.6MB → 0.5MB (9.3x), 21 JPEGs deleted\n2026-05-07T20:49:41.540139Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 28 frames, 5.1MB → 2.2MB (2.4x), 28 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:54:41.579472Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:54:42.613188Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.0x), 9 JPEGs deleted\n2026-05-07T20:54:43.513502Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.5MB (4.1x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:58:07.310317Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:07.435000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:08.835660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:09.276486Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:59:43.595276Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:59:44.636647Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T20:59:45.590852Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.2x), 10 JPEGs deleted\n2026-05-07T21:00:16.436168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:00:48.741587Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:00:55.766541Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:01.987730Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:19.657174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:04:45.665545Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T21:04:46.555243Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T21:04:47.505518Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.1MB → 0.3MB (6.3x), 11 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:07:59.390425Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:02.049042Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:58.406336Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:08:58.638209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:09:33.105308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:09:47.541287Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T21:09:48.491343Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:09:49.574479Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.8MB → 0.4MB (4.4x), 9 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:11:18.711785Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:11:43.731627Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:11:58.569054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:14:49.597611Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 29 eligible frames\n2026-05-07T21:14:50.698785Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (8.0x), 14 JPEGs deleted\n2026-05-07T21:14:53.637486Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.5MB → 0.6MB (4.4x), 13 JPEGs deleted\n2026-05-07T21:15:02.521080Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:15:56.220866Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:16:19.271233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:17:24.638614Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:30.785805Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:33.819916Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:40.291660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:44.647424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:44.850725Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:46.523321Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:49.556444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:19:53.705827Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 42 eligible frames\n2026-05-07T21:19:55.056907Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.6MB → 0.9MB (4.0x), 20 JPEGs deleted\n2026-05-07T21:19:56.759790Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.9MB → 1.1MB (3.4x), 20 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:20:29.459260Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:41.532773Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:57.170225Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.150037Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.320528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:27.422746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:22:21.936188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:22.033584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:50.292905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.735984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.914206Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.420221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.695513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:28.410976Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:36.882207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:37.074891Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.366576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.495008Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:49.547721Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:01.423031Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:04.466413Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:56.787200Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T21:24:57.817202Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (7.7x), 14 JPEGs deleted\n2026-05-07T21:24:59.081061Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.7MB (3.3x), 12 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:27:02.818198Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:27:05.774711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:28:30.450527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:29:59.102962Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T21:29:59.987011Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:30:01.159682Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.6MB → 0.9MB (2.7x), 13 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:35:01.331399Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T21:35:02.457282Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.4x), 10 JPEGs deleted\n2026-05-07T21:35:03.532280Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.8MB (2.1x), 8 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:39:18.435385Z INFO screenpipe_engine::sleep_monitor: Screen locked (CGSession safety-net poll)\n2026-05-07T21:39:34.938546Z INFO sck_rs::stream_manager: recreating stream for display 2 (resolution change)\n2026-05-07T21:40:03.554507Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:40:04.411131Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T21:40:05.319315Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.6MB (3.5x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:45:05.336676Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:45:06.184141Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (6.0x), 10 JPEGs deleted\n2026-05-07T21:45:06.960114Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.3MB (6.4x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:50:06.992344Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 18 eligible frames\n2026-05-07T21:50:07.821021Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.7MB → 0.4MB (4.6x), 8 JPEGs deleted\n2026-05-07T21:50:08.563068Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.3MB (5.1x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:50:34.305285Z WARN sqlx::query: summary=\"SELECT DISTINCT app_name, window_name, …\" db.statement=\"\\n\\nSELECT\\n DISTINCT app_name,\\n window_name,\\n browser_url\\nFROM\\n frames\\nWHERE\\n timestamp > datetime('now', '-30 seconds')\\n AND app_name IS NOT NULL\\n AND window_name IS NOT NULL\\n\" rows_affected=0 rows_returned=182 elapsed=1.9089s\n2026-05-07T21:50:34.470706Z INFO screenpipe_engine::sleep_monitor: Screen unlocked (CGSession safety-net poll)\n2026-05-07T21:50:34.479630Z INFO screenpipe_engine::event_driven_capture: invalidating persistent streams after unlock/wake for monitor 1\n2026-05-07T21:50:34.495040Z INFO sck_rs::stream_manager: stopped 1 persistent stream(s)\n2026-05-07T21:50:36.741433Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-07T21:50:37.714776Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)\nzsh: terminated npx screenpipe@latest record --disable-audio --ignored-windows \"Boosteroid\"\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sp-start\ndetected hardware tier: Mid\nwarning: parakeet is not supported on this platform, using whisper-tiny instead\n2026-05-08T09:25:44.404966Z INFO screenpipe_engine::auth_key: api auth: key resolved via secret store\nchecking permissions...\n screen recording: ok\n accessibility: ok\n2026-05-08T09:25:44.477216Z INFO screenpipe_screen::monitor::macos_version: Detected macOS version: 14.6\n2026-05-08T09:25:45.851716Z INFO screenpipe_engine::sleep_monitor: Starting macOS sleep/wake monitor\n2026-05-08T09:25:45.853302Z INFO screenpipe_engine::sleep_monitor: Screen lock/unlock observers registered (CFNotificationCenter)\n2026-05-08T09:25:45.853909Z INFO screenpipe_engine::sleep_monitor: Display reconfiguration watcher registered (CGDisplayRegisterReconfigurationCallback)\n2026-05-08T09:25:45.874540Z INFO screenpipe_engine::permission_monitor: permission monitor started screen=true mic=true accessibility=true keychain=true\n2026-05-08T09:25:45.874606Z INFO screenpipe: meeting detector enabled — independent of transcription mode\n2026-05-08T09:25:45.874891Z INFO screenpipe: API server listening on 127.0.0.1:3030 (localhost only)\n2026-05-08T09:25:45.874915Z INFO screenpipe: API auth enabled — run `screenpipe auth token` to view your key\n2026-05-08T09:25:45.874789Z INFO screenpipe_engine::power::manager: power manager started (poll interval: 10s)\n2026-05-08T09:25:45.874931Z INFO screenpipe_engine::vision_manager::manager: Starting VisionManager\n2026-05-08T09:25:45.874854Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction worker started (min_age=600s, poll=300s)\n2026-05-08T09:25:45.877906Z INFO screenpipe_core::pipes: loaded pipe: day-recap\n2026-05-08T09:25:45.878202Z INFO screenpipe_core::pipes: loaded pipe: standup-update\n2026-05-08T09:25:45.878737Z INFO screenpipe_core::pipes: loaded pipe: ai-habits\n2026-05-08T09:25:45.878843Z INFO screenpipe_core::pipes: loaded pipe: time-breakdown\n2026-05-08T09:25:45.878921Z INFO screenpipe_core::pipes: loaded pipe: video-export\n2026-05-08T09:25:45.878997Z INFO screenpipe_core::pipes: loaded pipe: meeting-summary\n2026-05-08T09:25:45.879015Z INFO screenpipe_core::pipes: loaded 6 pipes from \"/Users/lukas/.screenpipe/pipes\"\n\n\n\n _ \n __________________ ___ ____ ____ (_____ ___ \n / ___/ ___/ ___/ _ \\/ _ \\/ __ \\ / __ \\/ / __ \\/ _ \\\n (__ / /__/ / / __/ __/ / / / / /_/ / / /_/ / __/\n/____/\\___/_/ \\___/\\___/_/ /_/ / .___/_/ .___/\\___/ \n /_/ /_/ \n\n\n\npower AI by everything you've seen, said or heard\nopen source | runs locally | developer friendly\n\n\n┌────────────────────────┬────────────────────────────────────┐\n│ setting │ value │\n├────────────────────────┼────────────────────────────────────┤\n│ audio chunk duration │ 30 seconds │\n│ port │ 3030 │\n│ audio disabled │ true │\n│ vision disabled │ false │\n│ pause on DRM content │ false │\n│ audio engine │ Parakeet │\n│ vad engine │ Silero │\n│ data directory │ /Users/lukas/.screenpipe │\n│ debug mode │ false │\n│ telemetry │ true │\n│ use pii removal │ true │\n│ use all monitors │ true │\n2026-05-08T09:25:45.881529Z INFO screenpipe_core::pipes: pipe scheduler started (generation 2)\n│ ignored windows │ [\"Boosteroid\"] │\n│ included windows │ [] │\n│ cloud sync │ disabled │\n│ auto-destruct pid │ 0 │\n│ deepgram key │ not set │\n│ api auth │ enabled │\n│ encrypt secrets │ disabled │\n│ retention days │ 14 │\n│ retention mode │ media-only (keep transcripts) │\n├────────────────────────┼────────────────────────────────────┤\n│ languages │ │\n│ │ all languages │\n├────────────────────────┼────────────────────────────────────┤\n│ monitors │ │\n│ │ id: 1 │\n│ │ id: 2 │\n├────────────────────────┼────────────────────────────────────┤\n│ audio devices │ │\n│ │ disabled │\n└────────────────────────┴────────────────────────────────────┘\nyou are using local processing. all your data stays on your computer.\n\nwarning: telemetry is enabled. only error-level data will be sent.\nto disable, use the --disable-telemetry flag.\n\ncheck latest changes here: https://github.com/screenpipe/screenpipe/releases\n2026-05-08T09:25:45.881961Z INFO screenpipe: starting UI event capture\n2026-05-08T09:25:45.888762Z INFO screenpipe_engine::power::manager: initial power profile: Performance (on_ac=true, battery=Some(100))\n2026-05-08T09:25:45.891286Z WARN screenpipe: pi agent install failed: bun not found — install from https://bun.sh\n2026-05-08T09:25:45.896583Z INFO screenpipe_engine::ui_recorder: Starting UI event capture\n2026-05-08T09:25:45.913159Z INFO screenpipe_engine::ui_recorder: UI recording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca2\n2026-05-08T09:25:45.913483Z INFO screenpipe_engine::calendar_speaker_id: speaker identification: started (user_name=<not set>)\n2026-05-08T09:25:45.913512Z INFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warming from DB (2026-05-07 06:25:45.913511 UTC to 2026-05-08 06:25:45.913511 UTC)\n2026-05-08T09:25:45.914574Z INFO screenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)\n2026-05-08T09:25:45.923208Z INFO screenpipe_engine::server: Server listening on 127.0.0.1:3030\n2026-05-08T09:25:45.927056Z INFO screenpipe_connect::mdns: mdns: advertising screenpipe on port 3030\n2026-05-08T09:25:46.310992Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 1 (1440x900)\n2026-05-08T09:25:46.311039Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.311076Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.472936Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)\n2026-05-08T09:25:46.472968Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)\n2026-05-08T09:25:46.472981Z INFO screenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)\n2026-05-08T09:25:46.472989Z INFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)\n2026-05-08T09:25:46.473017Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 2 (device: monitor_2)\n2026-05-08T09:25:47.579143Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)","is_focused":true},{"role":"AXRadioButton","text":"DOCKER","depth":2,"bounds":{"left":0.0,"top":0.05888889,"width":0.16458334,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.004166667,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"DEV (-zsh)","depth":2,"bounds":{"left":0.16458334,"top":0.05888889,"width":0.16458334,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.16875,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"APP (-zsh)","depth":2,"bounds":{"left":0.32916668,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.33333334,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.49340278,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.49756944,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe\"","depth":2,"bounds":{"left":0.6576389,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.66180557,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.821875,"top":0.05888889,"width":0.16423611,"height":0.026666667},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.82604164,"top":0.06333333,"width":0.011111111,"height":0.017777778},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌥⌘1","depth":1,"bounds":{"left":0.95763886,"top":0.032222223,"width":0.03888889,"height":0.018888889},"on_screen":true,"automation_id":"_NS:8","role_description":"text"},{"role":"AXStaticText","text":"screenpipe\"","depth":1,"bounds":{"left":0.4722222,"top":0.033333335,"width":0.058333334,"height":0.017777778},"on_screen":true,"role_description":"text"}]...
|
4876713036620256964
|
3292597617511998841
|
manual
|
accessibility
|
NULL
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6418
|
276
|
0
|
2026-05-08T06:25:46.974234+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-08/1778 /Users/lukas/.screenpipe/data/data/2026-05-08/1778221546974_m2.jpg...
|
iTerm2
|
screenpipe"
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
[{"role":"AXTextArea","text [{"role":"AXTextArea","text":"2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted\n2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted\n2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted\n2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted\n2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames\n2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted\n2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted\n2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames\n2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted\n2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames\n2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted\n2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 27 eligible frames\n2026-05-07T19:23:59.596007Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.1x), 11 JPEGs deleted\n2026-05-07T19:24:00.891142Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 1.1MB (2.5x), 14 JPEGs deleted\n2026-05-07T19:24:36.746388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:24:42.261437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:14.335824Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:14.501546Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:18.608719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:21.337705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:21.444990Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:25:24.322060Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:24.497521Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.631670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.804593Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:48.848098Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:49.055257Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:50.343378Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:53.219355Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:57.486035Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:00.350562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:02.998552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:29:00.996820Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:29:01.829394Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:29:02.677714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:29:02.873130Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.6MB → 0.3MB (4.7x), 9 JPEGs deleted\n2026-05-07T19:29:04.454985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:33:45.474083Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:33:45.574703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:34:02.929639Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:34:03.929929Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:34:04.831248Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.5MB (3.5x), 9 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:35:53.066715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:53.134063Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.399034Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.529875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.116160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.346393Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:39:04.860519Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T19:39:05.856910Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.6MB → 0.4MB (6.7x), 12 JPEGs deleted\n2026-05-07T19:39:06.909595Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 0.7MB (3.7x), 14 JPEGs deleted\n2026-05-07T19:39:19.953400Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:39:20.056731Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:40:34.494177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:34.675208Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.270708Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.967552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:41.599046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:57.136251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.523231Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.647589Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.724759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.787705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.434115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.616452Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.527243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.698300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:14.547340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.343528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.590418Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.346968Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.515629Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.757356Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.887041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.509177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.588640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.303139Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.505341Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.522144Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.601138Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.452115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.613905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.532340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.604673Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.497340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.566719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.315300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.403707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.430309Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.652868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.261495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.329694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.033847Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.279174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:09.130409Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:10.760517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:10.955209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.694453Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.847513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:15.192740Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:19.512956Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:19.695051Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:21.240226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:23.249772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:23.420761Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.101390Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.267234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.661670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.974606Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.693430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.863787Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:43:06.877261Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:43:28.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:44:06.929510Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:44:07.972581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.1x), 9 JPEGs deleted\n2026-05-07T19:44:08.724886Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.3MB (5.5x), 9 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:46:32.604506Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.686719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.765553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:47:31.466526Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:31.528038Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.868347Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.952982Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.140388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.259157Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.653972Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.850397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.635498Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.917036Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.894122Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.983751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.565025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.841375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.389694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.487473Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:25.687327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:26.039544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.217166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.286508Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:34.275736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:48:52.975250Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.011047Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.138297Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.709233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.971474Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:57.903354Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:58.031638Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:08.831271Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T19:49:09.701210Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T19:49:09.988170Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.072461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.622231Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.4MB (4.6x), 10 JPEGs deleted\n2026-05-07T19:49:10.951952Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:11.179405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.213406Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.306678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.434554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.586646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.160394Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.333248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.653111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.788775Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.757003Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.850289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:09.824461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:51:43.978817Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.289204Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.534513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:55.912398Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:07.427464Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:09.914610Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:52:13.999305Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:53:08.137188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3408391724781151, trigger=click)\n2026-05-07T19:53:27.421048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:30.806727Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:55.298484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.229266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.570998Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:10.661598Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T19:54:11.829433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.5MB (5.9x), 13 JPEGs deleted\n2026-05-07T19:54:12.906285Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n2026-05-07T19:54:15.030478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:59:12.939770Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T19:59:14.064266Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.8MB (2.8x), 11 JPEGs deleted\n2026-05-07T19:59:15.028689Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.7MB (2.7x), 10 JPEGs deleted\n2026-05-07T19:59:19.676527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:20.298073Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:59:21.048802Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:47.204531Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:47.386007Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:49.129611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T19:59:57.544434Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:06.938913Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:07.019843Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:17.416687Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:17.621334Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.202076Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.302504Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.987921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:23.300585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:00:45.503937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:45.692395Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:02.738618Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:02:10.601351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:16.908580Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:17.153655Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:33.165320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:33.357830Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.707461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.880760Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:35.941695Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.002767Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.694797Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:39.767667Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:40.243974Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:40.447707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.474533Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.641646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.241150Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.344303Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.427245Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.673424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.360985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.438210Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:04:15.122581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 67 eligible frames\n2026-05-07T20:04:17.266857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 31 frames, 6.8MB → 0.4MB (16.5x), 31 JPEGs deleted\n2026-05-07T20:04:19.692224Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 34 frames, 6.6MB → 1.8MB (3.7x), 34 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:09:19.730149Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T20:09:20.868870Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.0x), 10 JPEGs deleted\n2026-05-07T20:09:21.872731Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.5MB (4.5x), 12 JPEGs deleted\n2026-05-07T20:10:22.481288Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:10:22.724929Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:10:33.403069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:16.881525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:17.206290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:25.414806Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:26.342065Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:12:00.633251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:12:00.764751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:14:21.899602Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T20:14:22.842168Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.5MB (4.6x), 11 JPEGs deleted\n2026-05-07T20:14:23.833238Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.8MB → 0.7MB (2.6x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:16:16.015969Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:16.262718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.386104Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.594387Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.837266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.988598Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.290499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.550857Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:18:22.484670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:19:23.913857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:19:24.908787Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:19:25.659631Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.6MB → 0.2MB (6.7x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:22:08.888954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:22:09.031478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:23:15.387842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:21.333524Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:25.728554Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T20:24:27.036433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:24:28.328187Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.3MB (3.9x), 8 JPEGs deleted\n2026-05-07T20:24:37.328678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:43.353544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:24:55.872936Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:58.540875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:25:35.867578Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:26:42.340931Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:13.971772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:16.626054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T20:29:18.382762Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.388168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.470946Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:28.365413Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 19 eligible frames\n2026-05-07T20:29:29.189708Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.2x), 9 JPEGs deleted\n2026-05-07T20:29:29.981681Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.4MB (3.6x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:30:27.218155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-145836613520700435, trigger=visual_change)\n2026-05-07T20:30:33.315754Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:33.648193Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n2026-05-07T20:30:36.262915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:54.441609Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:31:08.468287Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:08.761735Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.476804Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.743553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:21.987184Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:22.172149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.558168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.698858Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:31.444495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:31:34.876401Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:34.956738Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.136853Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.238905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.595439Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.965131Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.293555Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.374867Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.450792Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.657577Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.195028Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.394977Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:29.710963Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:29.885984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:45.920243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:33:06.673430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:34:29.989171Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T20:34:30.879482Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T20:34:31.909326Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.2MB → 0.5MB (4.6x), 13 JPEGs deleted\n2026-05-07T20:35:12.105375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:12.236548Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:35:26.184503Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:26.248722Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:26.954900Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:27.559499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:38.156973Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=visual_change)\n2026-05-07T20:36:47.814748Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:47.970282Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.338177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.459862Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:53.207924Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:37:08.617136Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.552854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.715161Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.450415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.568870Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:15.893763Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:16.129140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:37.989437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:38.224177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.686576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.774090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.769203Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.874600Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.392921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.578182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.161501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.405550Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.676454Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.752090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:38:25.338967Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:39:31.941232Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 30 eligible frames\n2026-05-07T20:39:33.328005Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.5MB → 0.7MB (3.5x), 12 JPEGs deleted\n2026-05-07T20:39:35.006471Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 16 frames, 3.0MB → 1.2MB (2.4x), 16 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:40:39.180298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:39.383232Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:40.832153Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=visual_change)\n2026-05-07T20:40:53.463842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6322393822977483, trigger=click)\n2026-05-07T20:40:53.767986Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:44:35.042198Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:44:35.901229Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T20:44:37.057277Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:47:14.469565Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:47:14.659492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:49:37.082051Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 51 eligible frames\n2026-05-07T20:49:38.725072Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 21 frames, 4.6MB → 0.5MB (9.3x), 21 JPEGs deleted\n2026-05-07T20:49:41.540139Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 28 frames, 5.1MB → 2.2MB (2.4x), 28 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:54:41.579472Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:54:42.613188Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.0x), 9 JPEGs deleted\n2026-05-07T20:54:43.513502Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.5MB (4.1x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:58:07.310317Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:07.435000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:08.835660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:09.276486Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:59:43.595276Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:59:44.636647Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T20:59:45.590852Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.2x), 10 JPEGs deleted\n2026-05-07T21:00:16.436168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:00:48.741587Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:00:55.766541Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:01.987730Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:19.657174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:04:45.665545Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T21:04:46.555243Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T21:04:47.505518Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.1MB → 0.3MB (6.3x), 11 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:07:59.390425Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:02.049042Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:58.406336Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:08:58.638209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:09:33.105308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:09:47.541287Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T21:09:48.491343Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:09:49.574479Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.8MB → 0.4MB (4.4x), 9 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:11:18.711785Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:11:43.731627Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:11:58.569054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:14:49.597611Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 29 eligible frames\n2026-05-07T21:14:50.698785Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (8.0x), 14 JPEGs deleted\n2026-05-07T21:14:53.637486Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.5MB → 0.6MB (4.4x), 13 JPEGs deleted\n2026-05-07T21:15:02.521080Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:15:56.220866Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:16:19.271233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:17:24.638614Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:30.785805Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:33.819916Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:40.291660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:44.647424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:44.850725Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:46.523321Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:49.556444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:19:53.705827Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 42 eligible frames\n2026-05-07T21:19:55.056907Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.6MB → 0.9MB (4.0x), 20 JPEGs deleted\n2026-05-07T21:19:56.759790Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.9MB → 1.1MB (3.4x), 20 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:20:29.459260Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:41.532773Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:57.170225Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.150037Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.320528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:27.422746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:22:21.936188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:22.033584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:50.292905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.735984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.914206Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.420221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.695513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:28.410976Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:36.882207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:37.074891Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.366576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.495008Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:49.547721Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:01.423031Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:04.466413Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:56.787200Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T21:24:57.817202Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (7.7x), 14 JPEGs deleted\n2026-05-07T21:24:59.081061Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.7MB (3.3x), 12 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:27:02.818198Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:27:05.774711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:28:30.450527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:29:59.102962Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T21:29:59.987011Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:30:01.159682Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.6MB → 0.9MB (2.7x), 13 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:35:01.331399Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T21:35:02.457282Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.4x), 10 JPEGs deleted\n2026-05-07T21:35:03.532280Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.8MB (2.1x), 8 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:39:18.435385Z INFO screenpipe_engine::sleep_monitor: Screen locked (CGSession safety-net poll)\n2026-05-07T21:39:34.938546Z INFO sck_rs::stream_manager: recreating stream for display 2 (resolution change)\n2026-05-07T21:40:03.554507Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:40:04.411131Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T21:40:05.319315Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.6MB (3.5x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:45:05.336676Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:45:06.184141Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (6.0x), 10 JPEGs deleted\n2026-05-07T21:45:06.960114Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.3MB (6.4x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:50:06.992344Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 18 eligible frames\n2026-05-07T21:50:07.821021Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.7MB → 0.4MB (4.6x), 8 JPEGs deleted\n2026-05-07T21:50:08.563068Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.3MB (5.1x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:50:34.305285Z WARN sqlx::query: summary=\"SELECT DISTINCT app_name, window_name, …\" db.statement=\"\\n\\nSELECT\\n DISTINCT app_name,\\n window_name,\\n browser_url\\nFROM\\n frames\\nWHERE\\n timestamp > datetime('now', '-30 seconds')\\n AND app_name IS NOT NULL\\n AND window_name IS NOT NULL\\n\" rows_affected=0 rows_returned=182 elapsed=1.9089s\n2026-05-07T21:50:34.470706Z INFO screenpipe_engine::sleep_monitor: Screen unlocked (CGSession safety-net poll)\n2026-05-07T21:50:34.479630Z INFO screenpipe_engine::event_driven_capture: invalidating persistent streams after unlock/wake for monitor 1\n2026-05-07T21:50:34.495040Z INFO sck_rs::stream_manager: stopped 1 persistent stream(s)\n2026-05-07T21:50:36.741433Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-07T21:50:37.714776Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)\nzsh: terminated npx screenpipe@latest record --disable-audio --ignored-windows \"Boosteroid\"\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sp-start\ndetected hardware tier: Mid\nwarning: parakeet is not supported on this platform, using whisper-tiny instead\n2026-05-08T09:25:44.404966Z INFO screenpipe_engine::auth_key: api auth: key resolved via secret store\nchecking permissions...\n screen recording: ok\n accessibility: ok\n2026-05-08T09:25:44.477216Z INFO screenpipe_screen::monitor::macos_version: Detected macOS version: 14.6\n2026-05-08T09:25:45.851716Z INFO screenpipe_engine::sleep_monitor: Starting macOS sleep/wake monitor\n2026-05-08T09:25:45.853302Z INFO screenpipe_engine::sleep_monitor: Screen lock/unlock observers registered (CFNotificationCenter)\n2026-05-08T09:25:45.853909Z INFO screenpipe_engine::sleep_monitor: Display reconfiguration watcher registered (CGDisplayRegisterReconfigurationCallback)\n2026-05-08T09:25:45.874540Z INFO screenpipe_engine::permission_monitor: permission monitor started screen=true mic=true accessibility=true keychain=true\n2026-05-08T09:25:45.874606Z INFO screenpipe: meeting detector enabled — independent of transcription mode\n2026-05-08T09:25:45.874891Z INFO screenpipe: API server listening on 127.0.0.1:3030 (localhost only)\n2026-05-08T09:25:45.874915Z INFO screenpipe: API auth enabled — run `screenpipe auth token` to view your key\n2026-05-08T09:25:45.874789Z INFO screenpipe_engine::power::manager: power manager started (poll interval: 10s)\n2026-05-08T09:25:45.874931Z INFO screenpipe_engine::vision_manager::manager: Starting VisionManager\n2026-05-08T09:25:45.874854Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction worker started (min_age=600s, poll=300s)\n2026-05-08T09:25:45.877906Z INFO screenpipe_core::pipes: loaded pipe: day-recap\n2026-05-08T09:25:45.878202Z INFO screenpipe_core::pipes: loaded pipe: standup-update\n2026-05-08T09:25:45.878737Z INFO screenpipe_core::pipes: loaded pipe: ai-habits\n2026-05-08T09:25:45.878843Z INFO screenpipe_core::pipes: loaded pipe: time-breakdown\n2026-05-08T09:25:45.878921Z INFO screenpipe_core::pipes: loaded pipe: video-export\n2026-05-08T09:25:45.878997Z INFO screenpipe_core::pipes: loaded pipe: meeting-summary\n2026-05-08T09:25:45.879015Z INFO screenpipe_core::pipes: loaded 6 pipes from \"/Users/lukas/.screenpipe/pipes\"\n\n\n\n _ \n __________________ ___ ____ ____ (_____ ___ \n / ___/ ___/ ___/ _ \\/ _ \\/ __ \\ / __ \\/ / __ \\/ _ \\\n (__ / /__/ / / __/ __/ / / / / /_/ / / /_/ / __/\n/____/\\___/_/ \\___/\\___/_/ /_/ / .___/_/ .___/\\___/ \n /_/ /_/ \n\n\n\npower AI by everything you've seen, said or heard\nopen source | runs locally | developer friendly\n\n\n┌────────────────────────┬────────────────────────────────────┐\n│ setting │ value │\n├────────────────────────┼────────────────────────────────────┤\n│ audio chunk duration │ 30 seconds │\n│ port │ 3030 │\n│ audio disabled │ true │\n│ vision disabled │ false │\n│ pause on DRM content │ false │\n│ audio engine │ Parakeet │\n│ vad engine │ Silero │\n│ data directory │ /Users/lukas/.screenpipe │\n│ debug mode │ false │\n│ telemetry │ true │\n│ use pii removal │ true │\n│ use all monitors │ true │\n2026-05-08T09:25:45.881529Z INFO screenpipe_core::pipes: pipe scheduler started (generation 2)\n│ ignored windows │ [\"Boosteroid\"] │\n│ included windows │ [] │\n│ cloud sync │ disabled │\n│ auto-destruct pid │ 0 │\n│ deepgram key │ not set │\n│ api auth │ enabled │\n│ encrypt secrets │ disabled │\n│ retention days │ 14 │\n│ retention mode │ media-only (keep transcripts) │\n├────────────────────────┼────────────────────────────────────┤\n│ languages │ │\n│ │ all languages │\n├────────────────────────┼────────────────────────────────────┤\n│ monitors │ │\n│ │ id: 1 │\n│ │ id: 2 │\n├────────────────────────┼────────────────────────────────────┤\n│ audio devices │ │\n│ │ disabled │\n└────────────────────────┴────────────────────────────────────┘\nyou are using local processing. all your data stays on your computer.\n\nwarning: telemetry is enabled. only error-level data will be sent.\nto disable, use the --disable-telemetry flag.\n\ncheck latest changes here: https://github.com/screenpipe/screenpipe/releases\n2026-05-08T09:25:45.881961Z INFO screenpipe: starting UI event capture\n2026-05-08T09:25:45.888762Z INFO screenpipe_engine::power::manager: initial power profile: Performance (on_ac=true, battery=Some(100))\n2026-05-08T09:25:45.891286Z WARN screenpipe: pi agent install failed: bun not found — install from https://bun.sh\n2026-05-08T09:25:45.896583Z INFO screenpipe_engine::ui_recorder: Starting UI event capture\n2026-05-08T09:25:45.913159Z INFO screenpipe_engine::ui_recorder: UI recording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca2\n2026-05-08T09:25:45.913483Z INFO screenpipe_engine::calendar_speaker_id: speaker identification: started (user_name=<not set>)\n2026-05-08T09:25:45.913512Z INFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warming from DB (2026-05-07 06:25:45.913511 UTC to 2026-05-08 06:25:45.913511 UTC)\n2026-05-08T09:25:45.914574Z INFO screenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)\n2026-05-08T09:25:45.923208Z INFO screenpipe_engine::server: Server listening on 127.0.0.1:3030\n2026-05-08T09:25:45.927056Z INFO screenpipe_connect::mdns: mdns: advertising screenpipe on port 3030\n2026-05-08T09:25:46.310992Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 1 (1440x900)\n2026-05-08T09:25:46.311039Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.311076Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.472936Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)\n2026-05-08T09:25:46.472968Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)\n2026-05-08T09:25:46.472981Z INFO screenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)\n2026-05-08T09:25:46.472989Z INFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)\n2026-05-08T09:25:46.473017Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 2 (device: monitor_2)\n2026-05-08T09:25:47.579143Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-08T09:25:47.807876Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)","depth":4,"on_screen":true,"value":"2026-05-07T18:54:10.198532Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:10.266719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.661911Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:12.842182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:19.916432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:33.125327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:36.216703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=visual_change)\n2026-05-07T18:54:40.760746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.130927Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:47.189988Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-725354089524067917, trigger=click)\n2026-05-07T18:54:54.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:54.554825Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.270880Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:55.497046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.231994Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:54:56.390410Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=8698828128144406184, trigger=click)\n2026-05-07T18:55:06.295831Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:07.396377Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:09.839989Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.048912Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:10.804975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:11.059957Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.429679Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:13.659109Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T18:55:23.935445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:24.058698Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.178955Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:25.277855Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.129525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:28.220403Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:29.968445Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.091636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.772215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:30.971040Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:32.549943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:32.978942Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:35.570244Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:47.355478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.021248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.071082Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:51.861594Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:53.391510Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:53.458575Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:54.852127Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:55:55.741088Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:55.784717Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:55:59.855145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:00.061907Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:03.871033Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:04.045971Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:06.982604Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:09.887383Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:10.072147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:12.860759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.008559Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.689350Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:13.888636Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.676147Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:16.858123Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:19.730668Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:21.116711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:22.863392Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=visual_change)\n2026-05-07T18:56:25.857382Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:25.944869Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.736339Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:27.968277Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7191546387729565793, trigger=click)\n2026-05-07T18:56:34.697492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:35.493000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:35.997405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:36.243674Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.035501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:38.253420Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:40.873703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:45.521180Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:48.170505Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=visual_change)\n2026-05-07T18:56:50.281026Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:50.469078Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.106211Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:56:51.210447Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:57:22.940226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:24.886659Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:24.943247Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.711432Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:27.778020Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:29.024539Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:39.958516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.017451Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.803199Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:40.851828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9060737059899569463, trigger=click)\n2026-05-07T18:57:44.583381Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9060737059899569463, trigger=visual_change)\n2026-05-07T18:57:53.646842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:57:59.683165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=visual_change)\n2026-05-07T18:58:01.681512Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:01.846528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.296271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:05.439879Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.063837Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:08.294769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5104323009125083167, trigger=click)\n2026-05-07T18:58:12.234562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:15.252484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=visual_change)\n2026-05-07T18:58:19.561623Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:19.616652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.527237Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:23.877910Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.554625Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:27.753207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:33.910173Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.138517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:34.809937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.056953Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:35.346155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.352776Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.504554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:37.976103Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.680653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:38.763338Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-2148254964752043084, trigger=click)\n2026-05-07T18:58:43.792492Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T18:58:44.847366Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.1x), 13 JPEGs deleted\n2026-05-07T18:58:46.331780Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.9MB (3.1x), 13 JPEGs deleted\n2026-05-07T18:58:48.678585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:48.746019Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.493557Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:49.753975Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.506759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:58:51.562677Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-7711496428252417823, trigger=click)\n2026-05-07T18:59:02.164937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:02.359714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:07.935656Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-4196246356071550057, trigger=click)\n2026-05-07T18:59:20.555025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:20.730118Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.230889Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:21.423662Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:24.957602Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:25.034890Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:30.508120Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:36.354586Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:41.219685Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T18:59:45.536516Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:54.454983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T18:59:57.496471Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:03.563631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:13.988490Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:00:20.601584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:00:24.762368Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:33.859654Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:37.007926Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:39.897769Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:00:42.942322Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:22.281415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:34.487702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:35.618441Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:37.608854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:38.423692Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:43.325171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:44.635564Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:45.829351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:01:47.566583Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:01:50.495459Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:02.758077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:05.639442Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:20.806652Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:26.822902Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:29.836228Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:38.912980Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:02:59.720424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:02:59.781165Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:03.524624Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:06.546298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:10.484878Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.021174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:12.881960Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:15.840626Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=visual_change)\n2026-05-07T19:03:16.930320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:17.004444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=7035948308583544848, trigger=click)\n2026-05-07T19:03:29.126718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:29.294389Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.141758Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:31.235461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:33.732408Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:03:35.376128Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:35.474160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:46.409563Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T19:03:47.459920Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.8MB → 0.4MB (7.3x), 13 JPEGs deleted\n2026-05-07T19:03:47.478596Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:47.685688Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:03:48.638329Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.9MB (2.7x), 11 JPEGs deleted\n2026-05-07T19:04:08.116536Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:08.325939Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.048145Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:09.143715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.071599Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:10.251285Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:23.971234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.733221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:32.860501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.720920Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:51.887707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.428290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:04:52.672954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.345560Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.435702Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:13.955499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:14.123752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.832581Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:16.921333Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.424048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:20.639049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:05:24.585422Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:24.763680Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:25.722186Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:26.037507Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:27.058882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:05:51.616832Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:27.553495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:49.097515Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:06:58.139828Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=visual_change)\n2026-05-07T19:07:00.501236Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2699748236748479093, trigger=click)\n2026-05-07T19:07:22.494893Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:07:25.541755Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:08:48.672330Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 49 eligible frames\n2026-05-07T19:08:49.959722Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 4.3MB → 0.4MB (10.2x), 20 JPEGs deleted\n2026-05-07T19:08:52.053246Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 27 frames, 5.5MB → 2.0MB (2.7x), 27 JPEGs deleted\n2026-05-07T19:09:24.524329Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:24.612542Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:09:56.724979Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:01.650171Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:01.826705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:02.894140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.771983Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:10:05.962915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.265782Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:08.415849Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.827601Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:21.956116Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:10:32.051747Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.141992Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:32.911018Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:33.089188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.381195Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:49.555111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:50.328077Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.206906Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:55.325017Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:57.111987Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:10:58.935835Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.791235Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:00.892227Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:04.654271Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5572763082875861589, trigger=visual_change)\n2026-05-07T19:11:09.783149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5572763082875861589, trigger=click)\n2026-05-07T19:11:10.922882Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:11:28.192704Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.083215Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:29.270039Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:33.962918Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:34.153653Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:42.021041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.349693Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:43.448166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:11:53.540965Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:56.520852Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=visual_change)\n2026-05-07T19:11:57.583112Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:11:57.675537Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2382966049842329946, trigger=click)\n2026-05-07T19:12:09.016494Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.193611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:09.920554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:10.162751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:17.749896Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:19.865640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:20.037736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:21.229308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:25.708397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:25.890046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.386069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:28.459158Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:29.987752Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:31.002923Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:31.055807Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:33.107450Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:36.037286Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:36.207370Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.110854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:12:39.184943Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:12:42.211049Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:13:52.073799Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 52 eligible frames\n2026-05-07T19:13:53.640097Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 5.4MB → 0.5MB (11.6x), 25 JPEGs deleted\n2026-05-07T19:13:56.148303Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 25 frames, 4.9MB → 2.1MB (2.4x), 25 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:15:32.114719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:32.277006Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.023332Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:34.221489Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:15:35.156276Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:41.068772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:15:44.092868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:18:56.195685Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 34 eligible frames\n2026-05-07T19:18:57.138533Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.0MB → 0.4MB (7.3x), 14 JPEGs deleted\n2026-05-07T19:18:58.608172Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 18 frames, 3.4MB → 1.3MB (2.6x), 18 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:22:06.254072Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:06.376479Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T19:22:07.042289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T19:23:58.623977Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 27 eligible frames\n2026-05-07T19:23:59.596007Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.1x), 11 JPEGs deleted\n2026-05-07T19:24:00.891142Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 1.1MB (2.5x), 14 JPEGs deleted\n2026-05-07T19:24:36.746388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:24:42.261437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:14.335824Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:14.501546Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:18.608719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:21.337705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:21.444990Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:25:24.322060Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:24.497521Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.631670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:29.804593Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:48.848098Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:49.055257Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:25:50.343378Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:53.219355Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:25:57.486035Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:00.350562Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:26:02.998552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:29:00.996820Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:29:01.829394Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:29:02.677714Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:29:02.873130Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.6MB → 0.3MB (4.7x), 9 JPEGs deleted\n2026-05-07T19:29:04.454985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:33:45.474083Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:33:45.574703Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:34:02.929639Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:34:03.929929Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T19:34:04.831248Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.5MB (3.5x), 9 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:35:53.066715Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:53.134063Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.399034Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:35:57.529875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.116160Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:36:00.346393Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:39:04.860519Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T19:39:05.856910Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.6MB → 0.4MB (6.7x), 12 JPEGs deleted\n2026-05-07T19:39:06.909595Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 2.7MB → 0.7MB (3.7x), 14 JPEGs deleted\n2026-05-07T19:39:19.953400Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:39:20.056731Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T19:40:34.494177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:34.675208Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.270708Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:37.967552Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:41.599046Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:57.136251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.523231Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:40:59.647589Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.724759Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:00.787705Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.434115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:09.616452Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.527243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:10.698300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:14.547340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.343528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:15.590418Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.346968Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:16.515629Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.757356Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:17.887041Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.509177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:25.588640Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.303139Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:29.505341Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.522144Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:31.601138Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.452115Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:32.613905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.532340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:36.604673Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.497340Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:41:58.566719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.315300Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:02.403707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.430309Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:03.652868Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.261495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:06.329694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.033847Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:07.279174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:09.130409Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:10.760517Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:10.955209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.694453Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:13.847513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:15.192740Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:19.512956Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:19.695051Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:21.240226Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:42:23.249772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:23.420761Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.101390Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.267234Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.661670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:46.974606Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.693430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:42:50.863787Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:43:06.877261Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:43:28.400631Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:44:06.929510Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T19:44:07.972581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.1x), 9 JPEGs deleted\n2026-05-07T19:44:08.724886Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.7MB → 0.3MB (5.5x), 9 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T19:46:32.604506Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.686719Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:46:33.765553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:47:31.466526Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:31.528038Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.868347Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:48.952982Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.140388Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:50.259157Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.653972Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:47:53.850397Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.635498Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:00.917036Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.894122Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:01.983751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.565025Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:02.841375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.389694Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:24.487473Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:25.687327Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:26.039544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.217166Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:27.286508Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:34.275736Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:48:52.975250Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.011047Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.138297Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.709233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:55.971474Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:57.903354Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:48:58.031638Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:08.831271Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T19:49:09.701210Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T19:49:09.988170Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.072461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:10.622231Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.4MB (4.6x), 10 JPEGs deleted\n2026-05-07T19:49:10.951952Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:11.179405Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.213406Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:12.306678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.434554Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:57.586646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.160394Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:49:58.333248Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.653111Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:00.788775Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.757003Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:01.850289Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:50:09.824461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T19:51:43.978817Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.289204Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:54.534513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:51:55.912398Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:07.427464Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:52:09.914610Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:52:13.999305Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=click)\n2026-05-07T19:53:08.137188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3408391724781151, trigger=click)\n2026-05-07T19:53:27.421048Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:30.806727Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-5837861084334909305, trigger=visual_change)\n2026-05-07T19:53:55.298484Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.229266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:02.570998Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:54:10.661598Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T19:54:11.829433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.7MB → 0.5MB (5.9x), 13 JPEGs deleted\n2026-05-07T19:54:12.906285Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n2026-05-07T19:54:15.030478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T19:59:12.939770Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T19:59:14.064266Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.8MB (2.8x), 11 JPEGs deleted\n2026-05-07T19:59:15.028689Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.7MB (2.7x), 10 JPEGs deleted\n2026-05-07T19:59:19.676527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:20.298073Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T19:59:21.048802Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T19:59:47.204531Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:47.386007Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T19:59:49.129611Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T19:59:57.544434Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:06.938913Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:07.019843Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:17.416687Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:17.621334Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.202076Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.302504Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:22.987921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3534927383007615310, trigger=click)\n2026-05-07T20:00:23.300585Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3534927383007615310, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:00:45.503937Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:00:45.692395Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:02.738618Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:02:10.601351Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:16.908580Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:17.153655Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:02:33.165320Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:33.357830Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.707461Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:34.880760Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:35.941695Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.002767Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:36.694797Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:39.767667Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:02:40.243974Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:40.447707Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.474533Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:41.641646Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.241150Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:45.344303Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.427245Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:46.673424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.360985Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:02:51.438210Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:04:15.122581Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 67 eligible frames\n2026-05-07T20:04:17.266857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 31 frames, 6.8MB → 0.4MB (16.5x), 31 JPEGs deleted\n2026-05-07T20:04:19.692224Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 34 frames, 6.6MB → 1.8MB (3.7x), 34 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:09:19.730149Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T20:09:20.868870Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.0x), 10 JPEGs deleted\n2026-05-07T20:09:21.872731Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.5MB (4.5x), 12 JPEGs deleted\n2026-05-07T20:10:22.481288Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:10:22.724929Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:10:33.403069Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:16.881525Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:17.206290Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:25.414806Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:11:26.342065Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:12:00.633251Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:12:00.764751Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:14:21.899602Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 23 eligible frames\n2026-05-07T20:14:22.842168Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.3MB → 0.5MB (4.6x), 11 JPEGs deleted\n2026-05-07T20:14:23.833238Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.8MB → 0.7MB (2.6x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:16:16.015969Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:16.262718Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.386104Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:16:30.594387Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.837266Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:23.988598Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.290499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:17:58.550857Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:18:22.484670Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:19:23.913857Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:19:24.908787Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:19:25.659631Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.6MB → 0.2MB (6.7x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:22:08.888954Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:22:09.031478Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:23:15.387842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:21.333524Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:25.728554Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T20:24:27.036433Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T20:24:28.328187Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.3MB (3.9x), 8 JPEGs deleted\n2026-05-07T20:24:37.328678Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:43.353544Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n2026-05-07T20:24:55.872936Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=click)\n2026-05-07T20:24:58.540875Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-9059054231720352226, trigger=visual_change)\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:25:35.867578Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:26:42.340931Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:13.971772Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:29:16.626054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=visual_change)\n2026-05-07T20:29:18.382762Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.388168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:19.470946Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5804206422380105340, trigger=click)\n2026-05-07T20:29:28.365413Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 19 eligible frames\n2026-05-07T20:29:29.189708Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.2x), 9 JPEGs deleted\n2026-05-07T20:29:29.981681Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.3MB → 0.4MB (3.6x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:30:27.218155Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-145836613520700435, trigger=visual_change)\n2026-05-07T20:30:33.315754Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:33.648193Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n2026-05-07T20:30:36.262915Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:30:54.441609Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=visual_change)\n2026-05-07T20:31:08.468287Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:08.761735Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.476804Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:09.743553Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:21.987184Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:22.172149Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.558168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:24.698858Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:31.444495Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=visual_change)\n2026-05-07T20:31:34.876401Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:34.956738Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.136853Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:31:57.238905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.595439Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:01.965131Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.293555Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:04.374867Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.450792Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:07.657577Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.195028Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:09.394977Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-247279566672962711, trigger=click)\n2026-05-07T20:32:29.710963Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:29.885984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:32:45.920243Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T20:33:06.673430Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:34:29.989171Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 26 eligible frames\n2026-05-07T20:34:30.879482Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T20:34:31.909326Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.2MB → 0.5MB (4.6x), 13 JPEGs deleted\n2026-05-07T20:35:12.105375Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:12.236548Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:35:26.184503Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:35:26.248722Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:26.954900Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:27.559499Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:36:38.156973Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=visual_change)\n2026-05-07T20:36:47.814748Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:47.970282Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.338177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:50.459862Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:36:53.207924Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:37:08.617136Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.552854Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:10.715161Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.450415Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:11.568870Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:15.893763Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:16.129140Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3779071910462057582, trigger=click)\n2026-05-07T20:37:37.989437Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:38.224177Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.686576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:40.774090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.769203Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:43.874600Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.392921Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:45.578182Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.161501Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:46.405550Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.676454Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:37:49.752090Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T20:38:25.338967Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=3981626442988875089, trigger=click)\n2026-05-07T20:39:31.941232Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 30 eligible frames\n2026-05-07T20:39:33.328005Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.5MB → 0.7MB (3.5x), 12 JPEGs deleted\n2026-05-07T20:39:35.006471Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 16 frames, 3.0MB → 1.2MB (2.4x), 16 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T20:40:39.180298Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:39.383232Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:40:40.832153Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=visual_change)\n2026-05-07T20:40:53.463842Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6322393822977483, trigger=click)\n2026-05-07T20:40:53.767986Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:44:35.042198Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T20:44:35.901229Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T20:44:37.057277Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 1.9MB → 0.8MB (2.3x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T20:47:14.469565Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:47:14.659492Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:49:37.082051Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 51 eligible frames\n2026-05-07T20:49:38.725072Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 21 frames, 4.6MB → 0.5MB (9.3x), 21 JPEGs deleted\n2026-05-07T20:49:41.540139Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 28 frames, 5.1MB → 2.2MB (2.4x), 28 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T20:54:41.579472Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:54:42.613188Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.0x), 9 JPEGs deleted\n2026-05-07T20:54:43.513502Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.5MB (4.1x), 10 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T20:58:07.310317Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:07.435000Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:08.835660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:58:09.276486Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T20:59:43.595276Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T20:59:44.636647Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 2.0MB → 0.4MB (5.4x), 9 JPEGs deleted\n2026-05-07T20:59:45.590852Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.4MB (5.2x), 10 JPEGs deleted\n2026-05-07T21:00:16.436168Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:00:48.741587Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:00:55.766541Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:01.987730Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:01:19.657174Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:04:45.665545Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 24 eligible frames\n2026-05-07T21:04:46.555243Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.4MB → 0.4MB (6.5x), 11 JPEGs deleted\n2026-05-07T21:04:47.505518Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 11 frames, 2.1MB → 0.3MB (6.3x), 11 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:07:59.390425Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:02.049042Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:08:58.406336Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:08:58.638209Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-3190010697038351257, trigger=click)\n2026-05-07T21:09:33.105308Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:09:47.541287Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 21 eligible frames\n2026-05-07T21:09:48.491343Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:09:49.574479Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 9 frames, 1.8MB → 0.4MB (4.4x), 9 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:11:18.711785Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=2730807366803551277, trigger=click)\n2026-05-07T21:11:43.731627Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:11:58.569054Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=-6936887013967671323, trigger=click)\n2026-05-07T21:14:49.597611Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 29 eligible frames\n2026-05-07T21:14:50.698785Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (8.0x), 14 JPEGs deleted\n2026-05-07T21:14:53.637486Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.5MB → 0.6MB (4.4x), 13 JPEGs deleted\n2026-05-07T21:15:02.521080Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=-6936887013967671323, trigger=click)\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:15:56.220866Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:16:19.271233Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:17:24.638614Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:30.785805Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:17:33.819916Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:40.291660Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:44.647424Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:44.850725Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:18:46.523321Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:18:49.556444Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:19:53.705827Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 42 eligible frames\n2026-05-07T21:19:55.056907Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.6MB → 0.9MB (4.0x), 20 JPEGs deleted\n2026-05-07T21:19:56.759790Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 20 frames, 3.9MB → 1.1MB (3.4x), 20 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:20:29.459260Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:41.532773Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:20:57.170225Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.150037Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:07.320528Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:21:27.422746Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=visual_change)\n2026-05-07T21:22:21.936188Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:22.033584Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=6913338268963121281, trigger=click)\n2026-05-07T21:22:50.292905Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.735984Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:16.914206Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.420221Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:18.695513Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:28.410976Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:36.882207Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:37.074891Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.366576Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:48.495008Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 1 (hash=5795911359130326036, trigger=click)\n2026-05-07T21:23:49.547721Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:01.423031Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:04.466413Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:24:56.787200Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 28 eligible frames\n2026-05-07T21:24:57.817202Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 14 frames, 3.1MB → 0.4MB (7.7x), 14 JPEGs deleted\n2026-05-07T21:24:59.081061Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 12 frames, 2.3MB → 0.7MB (3.3x), 12 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:27:02.818198Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:27:05.774711Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:28:30.450527Z INFO screenpipe_engine::event_driven_capture: content dedup: skipping capture for monitor 2 (hash=5795911359130326036, trigger=visual_change)\n2026-05-07T21:29:59.102962Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 25 eligible frames\n2026-05-07T21:29:59.987011Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.6x), 10 JPEGs deleted\n2026-05-07T21:30:01.159682Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 13 frames, 2.6MB → 0.9MB (2.7x), 13 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:35:01.331399Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 20 eligible frames\n2026-05-07T21:35:02.457282Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.4x), 10 JPEGs deleted\n2026-05-07T21:35:03.532280Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.8MB (2.1x), 8 JPEGs deleted\n\n tip: wire screenpipe into claude with one command:\n claude mcp add screenpipe -- npx -y screenpipe-mcp\n then ask claude to build a pipe that tracks who you are, your todos, and how you spend your time from your screen activity\n\n2026-05-07T21:39:18.435385Z INFO screenpipe_engine::sleep_monitor: Screen locked (CGSession safety-net poll)\n2026-05-07T21:39:34.938546Z INFO sck_rs::stream_manager: recreating stream for display 2 (resolution change)\n2026-05-07T21:40:03.554507Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:40:04.411131Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (5.7x), 10 JPEGs deleted\n2026-05-07T21:40:05.319315Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.6MB (3.5x), 10 JPEGs deleted\n\n tip: install a starter bundle of pipes:\n screenpipe install https://screenpi.pe/start.json\n\n2026-05-07T21:45:05.336676Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 22 eligible frames\n2026-05-07T21:45:06.184141Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.2MB → 0.4MB (6.0x), 10 JPEGs deleted\n2026-05-07T21:45:06.960114Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 10 frames, 2.0MB → 0.3MB (6.4x), 10 JPEGs deleted\n\n tip: sign in for higher AI quotas + cloud sync:\n screenpipe login\n\n2026-05-07T21:50:06.992344Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: found 18 eligible frames\n2026-05-07T21:50:07.821021Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.7MB → 0.4MB (4.6x), 8 JPEGs deleted\n2026-05-07T21:50:08.563068Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction: 8 frames, 1.6MB → 0.3MB (5.1x), 8 JPEGs deleted\n\n tip: get the screenpipe desktop app for the full experience\n https://screenpi.pe\n\n2026-05-07T21:50:34.305285Z WARN sqlx::query: summary=\"SELECT DISTINCT app_name, window_name, …\" db.statement=\"\\n\\nSELECT\\n DISTINCT app_name,\\n window_name,\\n browser_url\\nFROM\\n frames\\nWHERE\\n timestamp > datetime('now', '-30 seconds')\\n AND app_name IS NOT NULL\\n AND window_name IS NOT NULL\\n\" rows_affected=0 rows_returned=182 elapsed=1.9089s\n2026-05-07T21:50:34.470706Z INFO screenpipe_engine::sleep_monitor: Screen unlocked (CGSession safety-net poll)\n2026-05-07T21:50:34.479630Z INFO screenpipe_engine::event_driven_capture: invalidating persistent streams after unlock/wake for monitor 1\n2026-05-07T21:50:34.495040Z INFO sck_rs::stream_manager: stopped 1 persistent stream(s)\n2026-05-07T21:50:36.741433Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-07T21:50:37.714776Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)\nzsh: terminated npx screenpipe@latest record --disable-audio --ignored-windows \"Boosteroid\"\nlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sp-start\ndetected hardware tier: Mid\nwarning: parakeet is not supported on this platform, using whisper-tiny instead\n2026-05-08T09:25:44.404966Z INFO screenpipe_engine::auth_key: api auth: key resolved via secret store\nchecking permissions...\n screen recording: ok\n accessibility: ok\n2026-05-08T09:25:44.477216Z INFO screenpipe_screen::monitor::macos_version: Detected macOS version: 14.6\n2026-05-08T09:25:45.851716Z INFO screenpipe_engine::sleep_monitor: Starting macOS sleep/wake monitor\n2026-05-08T09:25:45.853302Z INFO screenpipe_engine::sleep_monitor: Screen lock/unlock observers registered (CFNotificationCenter)\n2026-05-08T09:25:45.853909Z INFO screenpipe_engine::sleep_monitor: Display reconfiguration watcher registered (CGDisplayRegisterReconfigurationCallback)\n2026-05-08T09:25:45.874540Z INFO screenpipe_engine::permission_monitor: permission monitor started screen=true mic=true accessibility=true keychain=true\n2026-05-08T09:25:45.874606Z INFO screenpipe: meeting detector enabled — independent of transcription mode\n2026-05-08T09:25:45.874891Z INFO screenpipe: API server listening on 127.0.0.1:3030 (localhost only)\n2026-05-08T09:25:45.874915Z INFO screenpipe: API auth enabled — run `screenpipe auth token` to view your key\n2026-05-08T09:25:45.874789Z INFO screenpipe_engine::power::manager: power manager started (poll interval: 10s)\n2026-05-08T09:25:45.874931Z INFO screenpipe_engine::vision_manager::manager: Starting VisionManager\n2026-05-08T09:25:45.874854Z INFO screenpipe_engine::snapshot_compaction: snapshot compaction worker started (min_age=600s, poll=300s)\n2026-05-08T09:25:45.877906Z INFO screenpipe_core::pipes: loaded pipe: day-recap\n2026-05-08T09:25:45.878202Z INFO screenpipe_core::pipes: loaded pipe: standup-update\n2026-05-08T09:25:45.878737Z INFO screenpipe_core::pipes: loaded pipe: ai-habits\n2026-05-08T09:25:45.878843Z INFO screenpipe_core::pipes: loaded pipe: time-breakdown\n2026-05-08T09:25:45.878921Z INFO screenpipe_core::pipes: loaded pipe: video-export\n2026-05-08T09:25:45.878997Z INFO screenpipe_core::pipes: loaded pipe: meeting-summary\n2026-05-08T09:25:45.879015Z INFO screenpipe_core::pipes: loaded 6 pipes from \"/Users/lukas/.screenpipe/pipes\"\n\n\n\n _ \n __________________ ___ ____ ____ (_____ ___ \n / ___/ ___/ ___/ _ \\/ _ \\/ __ \\ / __ \\/ / __ \\/ _ \\\n (__ / /__/ / / __/ __/ / / / / /_/ / / /_/ / __/\n/____/\\___/_/ \\___/\\___/_/ /_/ / .___/_/ .___/\\___/ \n /_/ /_/ \n\n\n\npower AI by everything you've seen, said or heard\nopen source | runs locally | developer friendly\n\n\n┌────────────────────────┬────────────────────────────────────┐\n│ setting │ value │\n├────────────────────────┼────────────────────────────────────┤\n│ audio chunk duration │ 30 seconds │\n│ port │ 3030 │\n│ audio disabled │ true │\n│ vision disabled │ false │\n│ pause on DRM content │ false │\n│ audio engine │ Parakeet │\n│ vad engine │ Silero │\n│ data directory │ /Users/lukas/.screenpipe │\n│ debug mode │ false │\n│ telemetry │ true │\n│ use pii removal │ true │\n│ use all monitors │ true │\n2026-05-08T09:25:45.881529Z INFO screenpipe_core::pipes: pipe scheduler started (generation 2)\n│ ignored windows │ [\"Boosteroid\"] │\n│ included windows │ [] │\n│ cloud sync │ disabled │\n│ auto-destruct pid │ 0 │\n│ deepgram key │ not set │\n│ api auth │ enabled │\n│ encrypt secrets │ disabled │\n│ retention days │ 14 │\n│ retention mode │ media-only (keep transcripts) │\n├────────────────────────┼────────────────────────────────────┤\n│ languages │ │\n│ │ all languages │\n├────────────────────────┼────────────────────────────────────┤\n│ monitors │ │\n│ │ id: 1 │\n│ │ id: 2 │\n├────────────────────────┼────────────────────────────────────┤\n│ audio devices │ │\n│ │ disabled │\n└────────────────────────┴────────────────────────────────────┘\nyou are using local processing. all your data stays on your computer.\n\nwarning: telemetry is enabled. only error-level data will be sent.\nto disable, use the --disable-telemetry flag.\n\ncheck latest changes here: https://github.com/screenpipe/screenpipe/releases\n2026-05-08T09:25:45.881961Z INFO screenpipe: starting UI event capture\n2026-05-08T09:25:45.888762Z INFO screenpipe_engine::power::manager: initial power profile: Performance (on_ac=true, battery=Some(100))\n2026-05-08T09:25:45.891286Z WARN screenpipe: pi agent install failed: bun not found — install from https://bun.sh\n2026-05-08T09:25:45.896583Z INFO screenpipe_engine::ui_recorder: Starting UI event capture\n2026-05-08T09:25:45.913159Z INFO screenpipe_engine::ui_recorder: UI recording session started: 03da4156-9bc1-4c59-86f8-3b937ccacca2\n2026-05-08T09:25:45.913483Z INFO screenpipe_engine::calendar_speaker_id: speaker identification: started (user_name=<not set>)\n2026-05-08T09:25:45.913512Z INFO screenpipe_engine::hot_frame_cache: hot_frame_cache: warming from DB (2026-05-07 06:25:45.913511 UTC to 2026-05-08 06:25:45.913511 UTC)\n2026-05-08T09:25:45.914574Z INFO screenpipe_engine::meeting_detector: meeting v2: detection loop started (base_interval=5s, profiles=12)\n2026-05-08T09:25:45.923208Z INFO screenpipe_engine::server: Server listening on 127.0.0.1:3030\n2026-05-08T09:25:45.927056Z INFO screenpipe_connect::mdns: mdns: advertising screenpipe on port 3030\n2026-05-08T09:25:46.310992Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 1 (1440x900)\n2026-05-08T09:25:46.311039Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.311076Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 1 (device: monitor_1)\n2026-05-08T09:25:46.472936Z INFO screenpipe_engine::vision_manager::manager: Starting vision recording for monitor 2 (3008x1253)\n2026-05-08T09:25:46.472968Z INFO screenpipe_engine::vision_manager::manager: Starting event-driven capture for monitor 2 (device: monitor_2)\n2026-05-08T09:25:46.472981Z INFO screenpipe_engine::vision_manager::manager: VisionManager started with 2/2 monitor(s)\n2026-05-08T09:25:46.472989Z INFO screenpipe_engine::vision_manager::monitor_watcher: Starting monitor watcher (event-driven via CGDisplayRegisterReconfigurationCallback, 60s backstop poll)\n2026-05-08T09:25:46.473017Z INFO screenpipe_engine::event_driven_capture: event-driven capture started for monitor 2 (device: monitor_2)\n2026-05-08T09:25:47.579143Z INFO sck_rs::stream_manager: persistent SCK stream started for display 1 (1440x900, 2fps, 2 excluded)\n2026-05-08T09:25:47.807876Z INFO sck_rs::stream_manager: persistent SCK stream started for display 2 (3008x1253, 2fps, 2 excluded)","is_focused":true},{"role":"AXRadioButton","text":"DOCKER","depth":2,"bounds":{"left":0.27027926,"top":1.0,"width":0.0787899,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.27227393,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"DEV (-zsh)","depth":2,"bounds":{"left":0.34906915,"top":1.0,"width":0.0787899,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.35106382,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"APP (-zsh)","depth":2,"bounds":{"left":0.42785904,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.42985374,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.5064827,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.5084774,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe\"","depth":2,"bounds":{"left":0.5851064,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.58710104,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"-zsh","depth":2,"bounds":{"left":0.66373,"top":1.0,"width":0.07862367,"height":-0.042298436},"on_screen":true,"role_description":"radio button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close Tab","depth":3,"bounds":{"left":0.66572475,"top":1.0,"width":0.005319149,"height":-0.04549086},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌥⌘1","depth":1,"bounds":{"left":0.7287234,"top":1.0,"width":0.01861702,"height":-0.023144484},"on_screen":true,"automation_id":"_NS:8","role_description":"text"},{"role":"AXStaticText","text":"screenpipe\"","depth":1,"bounds":{"left":0.49634308,"top":1.0,"width":0.027925532,"height":-0.02394259},"on_screen":true,"role_description":"text"}]...
|
-4419610272491045376
|
3292597617511998841
|
manual
|
accessibility
|
NULL
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6436
|
NULL
|
0
|
2026-05-08T06:26:45.825892+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-08/1778 /Users/lukas/.screenpipe/data/data/2026-05-08/1778221605825_m1.jpg...
|
iTerm2
|
NULL
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
NULL
|
-4688741099317385099
|
NULL
|
click
|
ocr
|
NULL
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
6437
|
NULL
|
0
|
2026-05-08T06:26:46.014552+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-08/1778 /Users/lukas/.screenpipe/data/data/2026-05-08/1778221606014_m2.jpg...
|
iTerm2
|
NULL
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
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...
|
NULL
|
-6167173405808356340
|
NULL
|
click
|
ocr
|
NULL
|
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...
|
6435
|
NULL
|
NULL
|
NULL
|