|
17214
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
HubSpot\Client\Crm\Deals\ApiException
[429] Client error: `GET [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.49ms DONE
cache [PASSWORD_DOTS] 21.31ms DONE
compiled [PASSWORD_DOTS] 3.11ms DONE
events [PASSWORD_DOTS] 5.05ms DONE
routes [PASSWORD_DOTS] 1.83ms DONE
views [PASSWORD_DOTS] 4.91ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 37.77ms DONE
cache [PASSWORD_DOTS] 58.83ms DONE
compiled [PASSWORD_DOTS] 9.93ms DONE
events [PASSWORD_DOTS] 12.23ms DONE
routes [PASSWORD_DOTS] 5.02ms DONE
views [PASSWORD_DOTS] 21.46ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.01ms DONE
cache [PASSWORD_DOTS] 16.11ms DONE
compiled [PASSWORD_DOTS] 2.91ms DONE
events [PASSWORD_DOTS] 2.27ms DONE
routes [PASSWORD_DOTS] 3.11ms DONE
views [PASSWORD_DOTS] 18.41ms DONE
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
SevenShores\Hubspot\Exceptions\BadRequest
Client error: `POST [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 55.84ms DONE
cache [PASSWORD_DOTS] 108.68ms DONE
compiled [PASSWORD_DOTS] 22.07ms DONE
events [PASSWORD_DOTS] 25.86ms DONE
routes [PASSWORD_DOTS] 19.91ms DONE
views [PASSWORD_DOTS] 52.25ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-audio:worker-audio_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
TypeError
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(): Return value must be of type Generator, none returned
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:83
79▕
80▕ // Update reference parameters
81▕ $total = $state->total;
82▕ $lastRecordId = $state->lastRecordId;
➜ 83▕ }
84▕
85▕ private function shouldStopPagination(PaginationState $state, int $teamId): bool
86▕ {
87▕ if ($state->hasReachedSafetyLimit()) {
1 app/Services/Crm/Hubspot/Client.php:195
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(Object(Jiminny\Services\Crm\Hubspot\Client), [], "contact")
2 app/Services/Crm/Hubspot/Client.php:176
Jiminny\Services\Crm\Hubspot\Client::getPaginatedDataGenerator([], "contact")
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.73ms DONE
cache [PASSWORD_DOTS] 19.13ms DONE
compiled [PASSWORD_DOTS] 4.93ms DONE
events [PASSWORD_DOTS] 3.02ms DONE
routes [PASSWORD_DOTS] 5.55ms DONE
views [PASSWORD_DOTS] 6.02ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.47ms DONE
cache [PASSWORD_DOTS] 16.66ms DONE
compiled [PASSWORD_DOTS] 3.26ms DONE
events [PASSWORD_DOTS] 3.99ms DONE
routes [PASSWORD_DOTS] 3.85ms DONE
views [PASSWORD_DOTS] 4.93ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.42ms DONE
cache [PASSWORD_DOTS] 23.70ms DONE
compiled [PASSWORD_DOTS] 3.46ms DONE
events [PASSWORD_DOTS] 4.30ms DONE
routes [PASSWORD_DOTS] 8.35ms DONE
views [PASSWORD_DOTS] 8.00ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.77ms DONE
cache [PASSWORD_DOTS] 25.55ms DONE
compiled [PASSWORD_DOTS] 3.87ms DONE
events [PASSWORD_DOTS] 4.96ms DONE
routes [PASSWORD_DOTS] 2.23ms DONE
views [PASSWORD_DOTS] 7.50ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
root@docker_lamp_1:/home/jiminny#
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug 007d5da3af66
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ git status
On branch JY-20725-handle-HS-search-rate-limit
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: app/Jobs/Middleware/HandleHubspotRateLimit.php
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .env.local
modified: app/Console/Commands/JiminnyDebugCommand.php
modified: app/Exceptions/RateLimitException.php
modified: app/Jobs/Activity/Import/MatchCrmData.php
modified: app/Jobs/Crm/MatchActivityCrmData.php
modified: app/Services/Crm/Hubspot/Client.php
modified: app/Services/Crm/Hubspot/HubspotClientInterface.php
modified: app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php
modified: app/Services/Crm/Hubspot/Pagination/PaginationState.php
modified: app/Services/Crm/Hubspot/Service.php
modified: config/logging.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.env.local.bak
.env.nikilocal
.env.other
WEBHOOK_FILTERING_IMPLEMENTATION.md
app/Console/Commands/Crm/Hubspot/SimulateWebhooksCommand.php
app/Console/Commands/Reports/CreateMockAskJiminnyReportResultCommand.php
ids.txt
public/favicon.ico
raw_sql_query.sql
tests/Unit/Policies/CanAccessAiReportsTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ gbr
* JY-20725-handle-HS-search-rate-limit
master
JY-20818-move-AJ-reports-to-separated-datadog-metric
JY-20773-fix-automated-reports-user-pilot-tracking
JY-20157-AJ-report-not-send-notification
JY-20508-notify-before-AJ-report-expiration
JY-20372-ai-reports-promotion-pages
JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
JY-20738-debug-AJ-tracking-UP
a
JY-18909-automated-reports-ask-jiminny
JY-20692-fix-integration-app-[API_KEY]
JY-20553-debug-crm-sync-delays
JY-20698-fix-SF-activity-types-on-new-playbook
JY-20543-AJ-report-tracking
JY-20384-handle-auto-sync-with-no-access-to-event-type
JY-20458-ask-jiminny-user-definitions
JY-19666-fix-import-contacts-account-association
JY-19666-HS-import-contacts-and-accounts-batch-job
JY-20458-Ask-Jiminny-Reports
JY-20200-batch-update-CRM-objects-Salesforce
JY-19666-HS-webhooks-add-contact-and-company
JY-20348-trigger-setup-DI-layout-on-team-creation
JY-20326-refactor-info-message-in-command
JY-20317-fix-auto-log-delay-issue-on-all-channels-disabled
JY-20312-remove-on-update-change-last-synced-at-crm-configurations
JY-20306-SF-skip-auto-sync-for-task-based-playbook
JY-20192-remove-deleted-team-from-saved-search-filters
JY-20197-import-opportunity-batch-job
JY-20293-enable-status-field-for-pipedrive-deals
JY-20191-remove-commands-interactive-prompts
JY-20118-change-default-sync-strategy
JY-20183-add-cache-on-auto-log-delay
JY-20197-add-import-opportunity-batch-job
20118-hs-opportunity-make-webhook-strategy-default
JY-20118-make-default-hs-opportunity-sync-strategy-webhook-based
JY-20196-handle-opportunity-without-note
JY-20118-improve-opportunity-import
JY-20189-handle-activity-search-on-deleted-groups
JY-20160
JY-20145-filter-out-converted-leads-when-matching
JY-20150-skip-push-summary-on-summary-ready-if-autolog
JY-20132-fix-note-encoding
JY-19792-clean-logs
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ dev
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'team_id' in 'WHERE' (Connection: mysql, Host: mariadb, Port: 3306, Database: jiminny, SQL: select * from `activities` where `team_id` = 2 and `activities`.`deleted_at` is null order by `id` desc limit 100)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:838
834▕ $exceptionType = $this->isUniqueConstraintError($e)
835▕ ? UniqueConstraintViolationException::class
836▕ : QueryException::class;
837▕
➜ 838▕ throw new $exceptionType(
839▕ $this->getNameWithReadWriteType(),
840▕ $query,
841▕ $this->prepareBindings($bindings),
842▕ $e,
+11 vendor frames
12 app/Console/Commands/JiminnyDebugCommand.php:380
Illuminate\Database\Eloquent\Builder::get()
13 app/Console/Commands/JiminnyDebugCommand.php:49
Jiminny\Console\Commands\JiminnyDebugCommand::simulateMatchActivityStorm()
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.01ms DONE
cache [PASSWORD_DOTS] 38.00ms DONE
compiled [PASSWORD_DOTS] 1.78ms DONE
events [PASSWORD_DOTS] 1.13ms DONE
routes [PASSWORD_DOTS] 1.56ms DONE
views [PASSWORD_DOTS] 3.25ms DONE
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-audio:worker-audio_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.34ms DONE
cache [PASSWORD_DOTS] 11.98ms DONE
compiled [PASSWORD_DOTS] 2.10ms DONE
events [PASSWORD_DOTS] 5.31ms DONE
routes [PASSWORD_DOTS] 2.90ms DONE
views [PASSWORD_DOTS] 13.11ms DONE
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
17214
|
|
17213
|
iTerm2• •ShellEditViewSessionScriptsProfilesWindow iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelp(ahlSupport Daily - in 1h 47 mDEV (docker)DOCKER881DEV (docker)H82APP (-zsh)-zsh84-zsh100%8• Mon 11 May 13:13:15181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17213
|
|
17212
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormVIewINavicareCodeLaravelFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitroledey(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>C build> contia→ contrio→ database>M docsM front-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv loasaitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass J1minnyDebuqcommand extends Commandprivate function natelamit1365ScrmService->syncOpportunity('374720564');ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht is= oauth-nrivate kevTacts naccod. 12 (10 minutes addWindowC) TrackAutomated ReportGeneratedzventonp© PlaybackController.php(c) HubSpot/Service.onphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.phpCachedcmmservicebecorator.ong© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.php© Job.phpm 45 A133 M11 ^hl# Support Daily - in 1h 47 m100% Lz• Mon 11 May 13:13:14HandleHubspotRateLimitTest v= custom.log X = laravel.log X 4 SF (jiminny@localhost]& HS_local [jiminny@localhost]« console (PROD]* console (EUl& console (STAGINGI[2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {V.19A"Date":["Thu,07 May 2026 14:21:15 GMT"],"Content-Type":["application/json;charset=utf-8"]."Transfer-Encoding": ["chunked"],"conneccion". Keep-alive"n"CF-Ray" : ["9f80deb8db60dc3a-SOF"],"CF-Cache-Status":"DYNAMIC")"Strict-Transport-Secur1ty":"max-aqe=31536000* 1ncLudesubDomains: preload")accept-encoding"],"access-control-allow-credentials": "false").server-timing": ["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\",cfn:desc="9-80de8ercodcSa-TAD"'"x-content-type-options": ["nosniff"]."x-hubsoot-correlation-id":"019e02d0-6fd8-7812-bdba-885b7ccb3ee3"]"Set-Cookie".[" cf bm=STUrtd0aXVrik50odaF6hZVYKhzTn0BidvMabeCtm0Y-1778163675-[IP_ADDRESS]-рT. ZaatDKxTae5zr8 2abBfWM00. ufZEXDZuHz2mBUFdzdo2aTHEs0)07-May-26 14:51:15 GMT; domain=.hubapi.com; Http0nly; Secure; SameSite=None"],"Renont-To".f","endnoints"•!\"url\":\"https:|V/\\/a.nel.cloudflare.com\\/report\\/v4?s=NYAlsVTP0fYm32qrSDjxYE4sd2RWRqiSp3wHsmdEgZlzoYdxI%2BIxVpHmsKn30%2BKVA3mFIJ2m7YRECDGS\"group\":\"cf-nel\",\"max_age\":604800}"],"success_fraction\":0.01,"report_to\":\"cf-nel\"\"max_age\":604800}"],"Server": ["cloudflare"]}} {"correlation id":"95236535-ec98-4541-b92a-adfa73b69eab"."trace_id":"c7ab8365-903f-46d4-9403-0e5b551e3545"}private function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam:.rindsteamla*scont10 = steam->geturmuontiqurationoSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arats: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):W Windsurf Teams 31:1 UTF-8 Pa 4 spaces ®...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17212
|
|
17211
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
iTerm2• 0ShellEditViewSessionScriptsProfilesWindowHelp(ahlSupport Daily - in 1h 47 mDEV (docker)DOCKERO ₴1DEV (docker)H82APP (-zsh)-zsh84-zsh100%8• Mon 11 May 13:13:13181screenpipe"#6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17211
|
|
17210
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
19
Previous Highlighted Error
Next Highlighted Error
[2026-05-07 14:21:15] local.INFO: [Hubspot] DEBUG Getting headers {
"headers":{
"Date":["Thu,07 May 2026 14:21:15 GMT"],
"Content-Type":["application/json;charset=utf-8"],
"Transfer-Encoding":["chunked"],
"Connection":["keep-alive"],
"CF-Ray":["9f80deb8db60dc3a-SOF"],
"CF-Cache-Status":["DYNAMIC"],
"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],
"Vary":["origin,
accept-encoding"],
"access-control-allow-credentials":["false"],
"server-timing":["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\",
cfr;desc=\"9f80deb8e7c6dc3a-IAD\""],
"x-content-type-options":["nosniff"],
"x-hubspot-correlation-id":["019e02d0-6fd8-7812-bdba-885b7ccb3ee3"],
"Set-Cookie":["__cf_bm=SIUrtdQgXVrik50pdqF6hZVYKhzTnQBidvMabeCtm0Y-1778163675-[IP_ADDRESS]-rI.ZggtDKxTge5zr8_2gbBfWMQQ.ufZEXDZyHz2mBUFdzdo2gTHEsOkXMSEShjK0hGYxNhUGM1ZoBpX7BcFZcHEjA7Cs_.SMUhUnd2nYjko; path=/; expires=Thu,
07-May-26 14:51:15 GMT; domain=.hubapi.com; HttpOnly; Secure; SameSite=None"],
"Report-To":["{
\"endpoints\":[{
\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=NYAlsVTP0fYm32qrSDjxYE4sd2RWRqiSp3wHsmdEgZlzoYdxI%2BIxVpHmsKn3O%2BKVA3mFIJ2m7YRECDGSM%2BW2IYTzo6FM4%2BdUIjURO8srzKSvJgZ%2BQ6R79arKQw3uHLlX\"}],
\"group\":\"cf-nel\",
\"max_age\":604800}"],
"NEL":["{
\"success_fraction\":0.01,
\"report_to\":\"cf-nel\",
\"max_age\":604800}"],
"Server":["cloudflare"]}} {
"correlation_id":"95236535-ec98-4541-b92a-adfa73b69eab",
"trace_id":"c7ab8365-903f-46d4-9403-0e5b551e3545"}...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17210
|
|
17209
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
19
Previous Highlighted Error...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17209
|
|
17208
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
117
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"jiminny:transcription:retry-failed","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d83a5ba9-7c8a-4992-ac02-eac41f3f1341","trace_id":"2d4632e6-6e41-4e94-9150-5c4aa440da7e"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"99ff0c29-2f18-45a9-962f-9e31324aeda3","trace_id":"8bef316a-cce3-491d-9cd7-77ad0fd7921c"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Command] Starting polling service {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Polling] Service starting {"memory_limit":"256M","max_execution_time":"0","initial_memory_mb":60.0} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Polling] Acquired polling lock {"expires_at":"2026-05-11T10:12:41.885003Z"} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Auth] Requesting new client credentials token {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"jiminny:transcription:retry-failed","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d83a5ba9-7c8a-4992-ac02-eac41f3f1341","trace_id":"2d4632e6-6e41-4e94-9150-5c4aa440da7e"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"99ff0c29-2f18-45a9-962f-9e31324aeda3","trace_id":"8bef316a-cce3-491d-9cd7-77ad0fd7921c"}
[2026-05-11 10:10:42] local.INFO: [HubSpot Journal Auth] Successfully obtained new access token {"expires_in":1800,"cached_for":1500} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:42] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:43] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:reset-governor","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"64fbcd1a-07e8-445a-9e49-2bcfd03b9822","trace_id":"3a093344-2c70-4c0a-a193-e5bded09ee55"}
[2026-05-11 10:10:43] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:reset-governor","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"64fbcd1a-07e8-445a-9e49-2bcfd03b9822","trace_id":"3a093344-2c70-4c0a-a193-e5bded09ee55"}
[2026-05-11 10:10:45] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d8584784-538a-4c97-b8ce-5bf5e8780961","trace_id":"4c1984e0-5cd2-4721-820a-f75e66ed92f3"}
[2026-05-11 10:10:45] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d8584784-538a-4c97-b8ce-5bf5e8780961","trace_id":"4c1984e0-5cd2-4721-820a-f75e66ed92f3"}
[2026-05-11 10:10:47] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:53] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:03] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:03] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:03] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a94f5e1e-af71-49f6-b541-dbd9a8d04e36","trace_id":"1abdc042-6e20-4130-ab95-d11cc838f266"}
[2026-05-11 10:11:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a94f5e1e-af71-49f6-b541-dbd9a8d04e36","trace_id":"1abdc042-6e20-4130-ab95-d11cc838f266"}
[2026-05-11 10:11:06] local.NOTICE: Monitoring start {"correlation_id":"12ccabef-7be2-42d4-ab4d-5a8016c5a98d","trace_id":"d06d7efd-f26f-4c05-908b-5c5e1c14351c"}
[2026-05-11 10:11:06] local.NOTICE: Monitoring end {"correlation_id":"12ccabef-7be2-42d4-ab4d-5a8016c5a98d","trace_id":"d06d7efd-f26f-4c05-908b-5c5e1c14351c"}
[2026-05-11 10:11:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"9c359ba1-7b44-4d41-b7c5-1308bbe9a481","trace_id":"7d72b0db-9094-4175-8aae-1687c8c6e09e"}
[2026-05-11 10:11:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"9c359ba1-7b44-4d41-b7c5-1308bbe9a481","trace_id":"7d72b0db-9094-4175-8aae-1687c8c6e09e"}
[2026-05-11 10:11:08] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:sync-hubspot-objects","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"67e6ae12-2d4b-4351-a186-0f5257095a10","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:sync-hubspot-objects","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"67e6ae12-2d4b-4351-a186-0f5257095a10","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:09] local.INFO: [SyncHubspotObjects] Starting sync {"team":"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4","usage":22929896,"real_usage":62914560,"pid":61146} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [HubSpot] Syncing opportunities using strategy: lastModified {"team":2} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/deals/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.61,"average_seconds_per_request":0.61} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [HubSpot] Synced opportunities {"team":2,"strategies":"lastModified","sync_count":0,"total":0,"last_synced_id":null,"duration_ms":630.48} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4","provider":"hubspot","status":"completed","duration_ms":700.68,"usage":23351880,"real_usage":62914560,"pid":61146} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Starting sync {"team":"b2b115eb-93ce-4d1b-929c-173757df8fba","usage":23330176,"real_usage":62914560,"pid":61146} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.WARNING: [HubSpot] Account not connected for user {"userId":"33e34a7a-1c02-4f04-87ac-22c3a385e6e3","account":{"Jiminny\\Models\\SocialAccount":{"id":306,"sociable_id":109,"provider_user_id":"11348452","expires":1701077403,"refresh_token_expires":null,"provider":"hubspot","state":"full-refresh","auth_scope":null,"retry_after":null,"created_at":"2020-09-01 16:59:04","updated_at":"2023-11-27 09:30:03"}}} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":109,"team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"b2b115eb-93ce-4d1b-929c-173757df8fba","provider":"hubspot","status":"disconnected","duration_ms":14.85,"usage":23416000,"real_usage":62914560,"pid":61146,"reason":"Your HubSpot account has become disconnected. Please login to Jiminny to reconnect."} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Starting sync {"team":"b2d49a54-b645-4637-a7ae-a86cfce6e8e4","usage":23373504,"real_usage":62914560,"pid":61146} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.WARNING: [HubSpot] Account not connected for user {"userId":"2ac0447f-3c8c-4ce0-baeb-b63ddb76fa9b","account":null} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":130,"team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"b2d49a54-b645-4637-a7ae-a86cfce6e8e4","provider":"hubspot","status":"disconnected","duration_ms":4.0,"usage":23393208,"real_usage":62914560,"pid":61146,"reason":"Social account for HubSpot cannot be found. Please login to Jiminny to connect."} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [SyncHubspotObjects] Starting sync {"team":"c6b9d6b0-b48d-4832-a68c-a57d60651888","usage":23353888,"real_usage":62914560,"pid":61146} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.WARNING: [HubSpot] Account not connected for user {"userId":"71e3aac5-fb66-47c5-a236-2d051ae3e319","account":null} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":256,"team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [SyncHubspotObjects] Sync finished {"team":"c6b9d6b0-b48d-4832-a68c-a57d60651888","provider":"hubspot","status":"disconnected","duration_ms":6.29,"usage":23389624,"real_usage":62914560,"pid":61146,"reason":"Social account for HubSpot cannot be found. Please login to Jiminny to connect."} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Service ending {"runtime_seconds":57,"total_cycles":5,"files_downloaded":0,"empty_files":0,"other_portal_skipped":0,"total_events":0,"events_per_file":0,"avg_api_ms":298.3,"avg_download_ms":0.0,"avg_transform_ms":0.0,"avg_process_ms":0.0,"peak_memory_mb":99.73} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Saved offset to database on cleanup {"offset":"019e15a9-9ea0-7da7-87bc-82592e3ccf0d"} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Released polling lock {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:12:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ded036eb-9a0e-4406-ac8a-d5afc4d3c34b","trace_id":"054932cb-a6a5-45c6-84b7-66a0df350115"}
[2026-05-11 10:12:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ded036eb-9a0e-4406-ac8a-d5afc4d3c34b","trace_id":"054932cb-a6a5-45c6-84b7-66a0df350115"}
[2026-05-11 10:12:07] local.NOTICE: Monitoring start {"correlation_id":"ae367bd8-c333-4290-9fb4-f2b4b1095c45","trace_id":"396ec9d2-f9ea-4130-bd81-821c991da070"}
[2026-05-11 10:12:07] local.NOTICE: Monitoring end {"correlation_id":"ae367bd8-c333-4290-9fb4-f2b4b1095c45","trace_id":"396ec9d2-f9ea-4130-bd81-821c991da070"}
[2026-05-11 10:12:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"3106bd28-29d3-4be8-9e46-20c799f8177f","trace_id":"999b0943-dd25-4fc7-bea1-122dec12a6c9"}
[2026-05-11 10:12:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"3106bd28-29d3-4be8-9e46-20c799f8177f","trace_id":"999b0943-dd25-4fc7-bea1-122dec12a6c9"}
[2026-05-11 10:12:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: Running conference:monitor:count command for activities in (2026-05-11 10:10:00, 2026-05-11 10:12:00] {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: [conference:monitor:count] No activities found in (2026-05-11 10:10:00, 2026-05-11 10:12:00] {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: [EmailSchedule] STARTING batch create {"host":"docker_lamp_1"} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: [EmailSchedule] FINISHED batch create {"host":"docker_lamp_1"} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:15] local.INFO: [Jiminny\Jobs\Mailbox\CreateBatches] processed 2 inboxes and created 0 batches {"userId":null,"batchSize":30,"maxBatches":1000} {"correlation_id":"f13e1f8b-4e17-4768-bcce-975174a521e6","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17208
|
|
17207
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
117
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"jiminny:transcription:retry-failed","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d83a5ba9-7c8a-4992-ac02-eac41f3f1341","trace_id":"2d4632e6-6e41-4e94-9150-5c4aa440da7e"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"99ff0c29-2f18-45a9-962f-9e31324aeda3","trace_id":"8bef316a-cce3-491d-9cd7-77ad0fd7921c"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Command] Starting polling service {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Polling] Service starting {"memory_limit":"256M","max_execution_time":"0","initial_memory_mb":60.0} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Polling] Acquired polling lock {"expires_at":"2026-05-11T10:12:41.885003Z"} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: [HubSpot Journal Auth] Requesting new client credentials token {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"jiminny:transcription:retry-failed","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d83a5ba9-7c8a-4992-ac02-eac41f3f1341","trace_id":"2d4632e6-6e41-4e94-9150-5c4aa440da7e"}
[2026-05-11 10:10:41] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-reminder","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"99ff0c29-2f18-45a9-962f-9e31324aeda3","trace_id":"8bef316a-cce3-491d-9cd7-77ad0fd7921c"}
[2026-05-11 10:10:42] local.INFO: [HubSpot Journal Auth] Successfully obtained new access token {"expires_in":1800,"cached_for":1500} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:42] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:43] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:reset-governor","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"64fbcd1a-07e8-445a-9e49-2bcfd03b9822","trace_id":"3a093344-2c70-4c0a-a193-e5bded09ee55"}
[2026-05-11 10:10:43] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:reset-governor","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"64fbcd1a-07e8-445a-9e49-2bcfd03b9822","trace_id":"3a093344-2c70-4c0a-a193-e5bded09ee55"}
[2026-05-11 10:10:45] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d8584784-538a-4c97-b8ce-5bf5e8780961","trace_id":"4c1984e0-5cd2-4721-820a-f75e66ed92f3"}
[2026-05-11 10:10:45] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:bullhorn:ping","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d8584784-538a-4c97-b8ce-5bf5e8780961","trace_id":"4c1984e0-5cd2-4721-820a-f75e66ed92f3"}
[2026-05-11 10:10:47] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:10:53] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:03] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:03] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:03] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"73074a2f-53f8-4f70-89f4-5e6b6f47709b","trace_id":"36cd19c8-14b0-4a6a-9b7e-3424a7d1bc17"}
[2026-05-11 10:11:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a94f5e1e-af71-49f6-b541-dbd9a8d04e36","trace_id":"1abdc042-6e20-4130-ab95-d11cc838f266"}
[2026-05-11 10:11:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a94f5e1e-af71-49f6-b541-dbd9a8d04e36","trace_id":"1abdc042-6e20-4130-ab95-d11cc838f266"}
[2026-05-11 10:11:06] local.NOTICE: Monitoring start {"correlation_id":"12ccabef-7be2-42d4-ab4d-5a8016c5a98d","trace_id":"d06d7efd-f26f-4c05-908b-5c5e1c14351c"}
[2026-05-11 10:11:06] local.NOTICE: Monitoring end {"correlation_id":"12ccabef-7be2-42d4-ab4d-5a8016c5a98d","trace_id":"d06d7efd-f26f-4c05-908b-5c5e1c14351c"}
[2026-05-11 10:11:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"9c359ba1-7b44-4d41-b7c5-1308bbe9a481","trace_id":"7d72b0db-9094-4175-8aae-1687c8c6e09e"}
[2026-05-11 10:11:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"9c359ba1-7b44-4d41-b7c5-1308bbe9a481","trace_id":"7d72b0db-9094-4175-8aae-1687c8c6e09e"}
[2026-05-11 10:11:08] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"9a948344-2e1a-4fb8-a656-beb4ad23301f","trace_id":"76e6c509-ef7b-4745-8eca-3032fb159759"}
[2026-05-11 10:11:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"crm:sync-hubspot-objects","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"67e6ae12-2d4b-4351-a186-0f5257095a10","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"crm:sync-hubspot-objects","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"67e6ae12-2d4b-4351-a186-0f5257095a10","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:09] local.INFO: [SyncHubspotObjects] Starting sync {"team":"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4","usage":22929896,"real_usage":62914560,"pid":61146} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [HubSpot] Syncing opportunities using strategy: lastModified {"team":2} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/deals/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.61,"average_seconds_per_request":0.61} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [HubSpot] Synced opportunities {"team":2,"strategies":"lastModified","sync_count":0,"total":0,"last_synced_id":null,"duration_ms":630.48} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"abae74b8-bfa8-4383-9a7f-89f4bf2bdbb4","provider":"hubspot","status":"completed","duration_ms":700.68,"usage":23351880,"real_usage":62914560,"pid":61146} {"correlation_id":"d8331589-ad87-4a95-b371-48d47b4352c3","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Starting sync {"team":"b2b115eb-93ce-4d1b-929c-173757df8fba","usage":23330176,"real_usage":62914560,"pid":61146} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.WARNING: [HubSpot] Account not connected for user {"userId":"33e34a7a-1c02-4f04-87ac-22c3a385e6e3","account":{"Jiminny\\Models\\SocialAccount":{"id":306,"sociable_id":109,"provider_user_id":"11348452","expires":1701077403,"refresh_token_expires":null,"provider":"hubspot","state":"full-refresh","auth_scope":null,"retry_after":null,"created_at":"2020-09-01 16:59:04","updated_at":"2023-11-27 09:30:03"}}} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":109,"team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":29} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"b2b115eb-93ce-4d1b-929c-173757df8fba","provider":"hubspot","status":"disconnected","duration_ms":14.85,"usage":23416000,"real_usage":62914560,"pid":61146,"reason":"Your HubSpot account has become disconnected. Please login to Jiminny to reconnect."} {"correlation_id":"d00035c0-2411-48e7-878a-00d30867227f","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Starting sync {"team":"b2d49a54-b645-4637-a7ae-a86cfce6e8e4","usage":23373504,"real_usage":62914560,"pid":61146} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.WARNING: [HubSpot] Account not connected for user {"userId":"2ac0447f-3c8c-4ce0-baeb-b63ddb76fa9b","account":null} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":130,"team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":42} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:10] local.INFO: [SyncHubspotObjects] Sync finished {"team":"b2d49a54-b645-4637-a7ae-a86cfce6e8e4","provider":"hubspot","status":"disconnected","duration_ms":4.0,"usage":23393208,"real_usage":62914560,"pid":61146,"reason":"Social account for HubSpot cannot be found. Please login to Jiminny to connect."} {"correlation_id":"ed0fe615-2f20-4623-a363-f431815541dd","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [SyncHubspotObjects] Starting sync {"team":"c6b9d6b0-b48d-4832-a68c-a57d60651888","usage":23353888,"real_usage":62914560,"pid":61146} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.WARNING: [HubSpot] Account not connected for user {"userId":"71e3aac5-fb66-47c5-a236-2d051ae3e319","account":null} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] Integration owner is not connected, attempting team members {"crm_provider":"hubspot","crm_owner":256,"team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] No team members found with active crm connection {"crm_provider":"hubspot","team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [CrmOwnerResolver] No team member found with active crm connection {"crm_provider":"hubspot","team_id":49} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:11] local.INFO: [SyncHubspotObjects] Sync finished {"team":"c6b9d6b0-b48d-4832-a68c-a57d60651888","provider":"hubspot","status":"disconnected","duration_ms":6.29,"usage":23389624,"real_usage":62914560,"pid":61146,"reason":"Social account for HubSpot cannot be found. Please login to Jiminny to connect."} {"correlation_id":"46313ede-79a7-4abc-8fca-546bee451887","trace_id":"f9028d3d-9fe1-4fcd-ac1c-0755b68c1246"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] No data {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.WARNING: [HubSpot Journal Polling] Maximum empty results reached, stopping {"empty_results":5,"max_empty_results":5} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Service ending {"runtime_seconds":57,"total_cycles":5,"files_downloaded":0,"empty_files":0,"other_portal_skipped":0,"total_events":0,"events_per_file":0,"avg_api_ms":298.3,"avg_download_ms":0.0,"avg_transform_ms":0.0,"avg_process_ms":0.0,"peak_memory_mb":99.73} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Saved offset to database on cleanup {"offset":"019e15a9-9ea0-7da7-87bc-82592e3ccf0d"} {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:11:38] local.INFO: [HubSpot Journal Polling] Released polling lock {"correlation_id":"a01eeb3d-e3cf-49ee-9762-ecc743d92c17","trace_id":"c95938bc-9632-49f6-a33e-43772f28fa18"}
[2026-05-11 10:12:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:04] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:04] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"12551a2b-46a3-4c27-9ead-b3763ff0f338","trace_id":"5ede2537-19cf-461b-89df-21fdc7ec86df"}
[2026-05-11 10:12:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ded036eb-9a0e-4406-ac8a-d5afc4d3c34b","trace_id":"054932cb-a6a5-45c6-84b7-66a0df350115"}
[2026-05-11 10:12:05] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ded036eb-9a0e-4406-ac8a-d5afc4d3c34b","trace_id":"054932cb-a6a5-45c6-84b7-66a0df350115"}
[2026-05-11 10:12:07] local.NOTICE: Monitoring start {"correlation_id":"ae367bd8-c333-4290-9fb4-f2b4b1095c45","trace_id":"396ec9d2-f9ea-4130-bd81-821c991da070"}
[2026-05-11 10:12:07] local.NOTICE: Monitoring end {"correlation_id":"ae367bd8-c333-4290-9fb4-f2b4b1095c45","trace_id":"396ec9d2-f9ea-4130-bd81-821c991da070"}
[2026-05-11 10:12:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"3106bd28-29d3-4be8-9e46-20c799f8177f","trace_id":"999b0943-dd25-4fc7-bea1-122dec12a6c9"}
[2026-05-11 10:12:08] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"3106bd28-29d3-4be8-9e46-20c799f8177f","trace_id":"999b0943-dd25-4fc7-bea1-122dec12a6c9"}
[2026-05-11 10:12:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a192c773-c319-4b3f-8012-7356de939b7d","trace_id":"242ecc24-28d0-40e1-8792-1ccf398b465d"}
[2026-05-11 10:12:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: Running conference:monitor:count command for activities in (2026-05-11 10:10:00, 2026-05-11 10:12:00] {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: [conference:monitor:count] No activities found in (2026-05-11 10:10:00, 2026-05-11 10:12:00] {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:11] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3754378-b33d-457a-b394-372f4ff578fb","trace_id":"4b2d5a64-4c62-422a-9b51-30d520dea401"}
[2026-05-11 10:12:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: [EmailSchedule] STARTING batch create {"host":"docker_lamp_1"} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: [EmailSchedule] FINISHED batch create {"host":"docker_lamp_1"} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:13] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:create","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"fd5f2428-deab-4b35-b3bf-3424dd8e5cb9","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
[2026-05-11 10:12:15] local.INFO: [Jiminny\Jobs\Mailbox\CreateBatches] processed 2 inboxes and created 0 batches {"userId":null,"batchSize":30,"maxBatches":1000} {"correlation_id":"f13e1f8b-4e17-4768-bcce-975174a521e6","trace_id":"fb68b806-9e36-46e3-b491-5e5772f5d19b"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17207
|
|
17206
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17206
|
|
17205
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17205
|
|
17204
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17204
|
|
17203
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
iTerm2• 0ShellEditViewSessionScriptsProfilesWindowHelpSupport Daily - in 1h 48 mDEV (docker)DOCKERO ₴1DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:12:21181screenpipe"·6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17203
|
|
17202
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
19
Previous Highlighted Error
Next Highlighted Error
[2026-05-07 14:21:15] local.INFO: [Hubspot] DEBUG Getting headers {
"headers":{
"Date":["Thu,07 May 2026 14:21:15 GMT"],
"Content-Type":["application/json;charset=utf-8"],
"Transfer-Encoding":["chunked"],
"Connection":["keep-alive"],
"CF-Ray":["9f80deb8db60dc3a-SOF"],
"CF-Cache-Status":["DYNAMIC"],
"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],
"Vary":["origin,
accept-encoding"],
"access-control-allow-credentials":["false"],
"server-timing":["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\",
cfr;desc=\"9f80deb8e7c6dc3a-IAD\""],
"x-content-type-options":["nosniff"],
"x-hubspot-correlation-id":["019e02d0-6fd8-7812-bdba-885b7ccb3ee3"],
"Set-Cookie":["__cf_bm=SIUrtdQgXVrik50pdqF6hZVYKhzTnQBidvMabeCtm0Y-1778163675-[IP_ADDRESS]-rI.ZggtDKxTge5zr8_2gbBfWMQQ.ufZEXDZyHz2mBUFdzdo2gTHEsOkXMSEShjK0hGYxNhUGM1ZoBpX7BcFZcHEjA7Cs_.SMUhUnd2nYjko; path=/; expires=Thu,
07-May-26 14:51:15 GMT; domain=.hubapi.com; HttpOnly; Secure; SameSite=None"],
"Report-To":["{
\"endpoints\":[{
\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=NYAlsVTP0fYm32qrSDjxYE4sd2RWRqiSp3wHsmdEgZlzoYdxI%2BIxVpHmsKn3O%2BKVA3mFIJ2m7YRECDGSM%2BW2IYTzo6FM4%2BdUIjURO8srzKSvJgZ%2BQ6R79arKQw3uHLlX\"}],
\"group\":\"cf-nel\",
\"max_age\":604800}"],
"NEL":["{
\"success_fraction\":0.01,
\"report_to\":\"cf-nel\",
\"max_age\":604800}"],
"Server":["cloudflare"]}} {
"correlation_id":"95236535-ec98-4541-b92a-adfa73b69eab",
"trace_id":"c7ab8365-903f-46d4-9403-0e5b551e3545"}...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17202
|
|
17201
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17201
|
|
17200
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17200
|
|
17199
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17199
|
|
17198
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17198
|
|
17197
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17197
|
|
17196
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
52
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"activity:purge-stale","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c04fa6c3-a917-4fce-b89d-3c1af9a28511","trace_id":"c0fb05b3-40c3-4cc4-884f-c0db504b3233"}
[2026-05-11 10:10:25] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:26] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:text-relay:sync","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"926d92be-5aec-4e59-b010-b472242f7b4d","trace_id":"81f90280-364b-484d-87fd-a632de4d7463"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:28] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notification","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id":"719ff411-0dc0-40a6-b80c-b17dc245dafc"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: [conference:monitor:start] No activities found in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:29] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4480570-3346-4f0b-8599-497297f10cdc","trace_id":"cecfe84a-5b36-4024-a7cc-9c1126c6159d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesEnded {"from":"10:05","to":"10:10"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: conference:monitor:end:Jiminny\Console\Commands\Activities\MonitorMeetingEndCommand::logActivitiesWithUnfinishedSession {"from":"00:00","to":"00:05"} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"c3403c79-cb5c-4402-94d3-97fcbd80ca23","trace_id":"edf3b692-e130-4be2-bf2f-3c784f7f864d"}
[2026-05-11 10:10:32] local.NOTICE: Repairing HubSpot tokens start {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":59,"provider":"hubspot","refreshToken":"97b78f6e2cc49965c00c2492b602b02708b1392551e6b3f113fbaa48992af90b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.ERROR: Failed to refresh HubSpot token {"account_id":59,"updated_at":"2025-10-03 09:32:05","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: Trying to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":306,"provider":"hubspot","refreshToken":"6fa6aa8cc641d131231acc3470f5c03cb3b07b2e580fb18f8acb3b1dbb72549b","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":306,"updated_at":"2023-11-27 09:30:03","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: Trying to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1372,"provider":"hubspot","refreshToken":"9aa73948c761da29dce46c177cf9aee1fde483a44169ca38723f9f0597d7a8c4","state":"full-refresh"} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or invalid refresh token","previous":""} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}
[2026-05-11 10:10:33] local.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e","trace_id":"7eef381a-721d-4d2a-9f57-a1dc2c256af5"}...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17196
|
|
17195
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
iTerm2• 0ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKERO ₴1DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:37181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17195
|
|
17194
|
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitroledeyC) TrackAutomated ReportGeneratedzventonp(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsM front-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht is= oauth-nrivate kevprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam::rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity) &Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):T. DeleteCrmEntitylrait.ong© Job.phpm A5 A133 M11 ^Support Daily - in 1h 50 m100% 2= laravel.log X 4 SF [jiminny@localhost]& HS_local [jiminny@localhost]console [PRODconsole fEulA console [STAGING]X Cc W .*150 A[2026-05-11 10:10:24] Local.INF0: Jiminny Console \Commands \Command::run Memory usage before starting command 1"command": "activity:purge-stale",2026-05-11 19:10-24•nen saWae himinoy Tronso le Trommands Thommandeanun Memony usade ion commanucomma taua ci vaty ne ne- sa leut memony net tor[2026-05-11 10:10:25]local.INF0: Jiminny \Console\Commands \Command::run Memory usage before starting command {"command":"mailbox:text-relay:syn2026-05-1010226 BC0EENEOR NGiminny Vonsolle Vommands Vommandeanun Memony usade for command ("command" -"mari lhoxatexitanel layasyno""memonyRr[2026-05-11 10:10:281local.INFO: Jiminny \Console\Commands\Command::run Memory usage before starting command {"command":"conference:pre-meeting2026-05-11 10-10-2811local.INF0: Running pre-meeting notification command {"correlation_id":"ed5c669e-af91-4886-a8b4-5f9ffd9d32a5","trace_id"2024-05-11 19•10-2911local.INF0: Jiminny \Console\Commands\Command::run Memory usage for command {"command":"conference:pre-meeting-notificatio[2026-05-11 10:10:29]local.INF0: Jiminny \Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:sta[2026-05-11 10:10:29]local.INF0: Running conference:monitor:start command for activities in (2026-05-11 10:00:00, 2026-05-11 10:05:00] {"corn[2026-05-11 10:10:29]local TNS0• [confenenco•moniton•ctan+l No activitioc found in (2024-05-11 10-00•00 2024-05-11 10-05•9011[2026-05-11 10:10:29] local.INF0: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:start" "memoryE[2026-05-11 10:10:30]local.INF0: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor: eng[2026-05-11 10:10:30]local.INF0: conference:monitor:end:Jiminny Console\Commands Activities \MonitorMeetingEndCommand::logActivitiesEnded {"fro[2026-05-11 10:10:30] local.INF0: conference:monitor:end:Jiminny Console\Commands\Activities MonitorMeetingEndCommand::logActivitiesWithUnfinis[2026-05-11 10:10:30] local.INF0: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:end" "memoryBef[2026-05-11 10:10:321local.NOTICE: Repairing HubSpot tokens start {"correlation_id"."afcf7ed2-9b29-4c5a-ad3f-1048afae1f7e" "trace_id". "7eef382026-05-14 70101521[2026-05-11 10:10:321Local.IN-u"Trying to refresh HubSpot token {"account id":59 "updated at"."2025-10-03 09:32:05"} {"correlation_id"."afcf7cyptedTokenManager] Generating access token. {"mode"."legacv"? {"correlation_id"."afcf7ed2-9b29-4c5a-ad3f2026-05-11 10:10:3211[2026-05-11 10:10:321SocialAccountServicel Refreshina token from provider "socialAccountld":59."providen":"hubsoot"."refreshtoke"reason": "missina or inv2026-05-11 10:10:3211[2026-05-11 10:10:321Trvina to refresh HubSoot token "account 1d":306."uodated at":"2023-11-217 09:30:03"* *"correlation1d":"afcf[EncryptedTokenManager] Generating access token. {"mode"."legacv"? {"correlation id"."afcf7ed2-9b29-4c5a-ad3f2026-05-11 10:10132[2026-05-11 10:10:331•Social AccountServicel Refreshind token from onovider usocial Accountild" 1306. "neoyiden". "hubsnot""nefreshilokFailed to refresh HubSnot token {"account id"•306 "undated at"."2023-11-27 09•30:03" "reason"."missina on in10:10:3312026-05-11 10:10:33]Trvinato refresh HubSnot token «"account 1d":1372 "undated at":"2025-10-02 14:47:06" "correlation id"-"lafc[EncrvotedTokenManager] Generatina access token. {"mode"."leoacv"? {"correlation id"."afcf7ed2-9b29-4c5a-ad3+2026-05-11 10:10:331[2026-05-11 10:10:33]2026-05-11 19•19•3371SocialAccountServicel Refreshina token from orovider "socialAccountId": 1372 "oroviden"«"hubsnot" "refreshtclocal.ERROR: Failed to refresh HubSpot token {"account_id":1372,"updated_at":"2025-10-02 14:47:06","reason":"missing or ilocal.NOTICE: Repairing HubSpot tokens end {"total":3,"fixed":0,"failed":3} {"correlation_id":"afcf7ed2-9b29-4c5a-ad3f-10WN Windsurf Toams 15-40 UTF.8 #l A enacod...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17194
|
|
17193
|
iTerm2• •ShellEditViewSessionScriptsProfilesWindow iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKER-₴81DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:35181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17193
|
|
17192
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17192
|
|
17191
|
iTerm2• 0ShellEditViewSessionScriptsProfilesWindow iTerm2• 0ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKER₴1DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:33181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17191
|
|
17190
|
PhostormVIewINavicareCodeLaravelFV faVsco.js?9 JY- PhostormVIewINavicareCodeLaravelFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitProletey(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>C build> contia→ contrio→ database>M docsfront-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht is= oauth-nrivate kevWindowC) TrackAutomated ReportGeneratedzventonp© UserAutomatedReportsController.php© PlaybackController.phpC Hubspot/Service.php©HubSpot/Service.phpyhudspotsynestrategybase.ongT SyncCrmEntitiesTrait.phpCachedCrmServiceDecorator.php© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.phpRematchActivityOnCrmObjectDetach.php© CheckAndRetryRemoteMatch.php© MatchActivityCrmData.php© Job.phpphp_ide_helper.php©) Paginationstate.php© MatchCrmData.php© CrmObjectsResolver.phpM A5 A133 X11 ^ Vhel"suppont Dally • In 1h o0m100% 47. • Mon 11 May 13:10:32HandleHubspotRateLimitTest= custom.log X = laravel.log X 4 SF [jiminny@localhost]& HS_local [jiminny@localhost]« console (PROD]* console (EUlA console [STAGING]Q- MatchActivityCrmDataX Cc W .*private function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam:.rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):Eio 4 spaces ©...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17190
|
|
17189
|
iTerm2• •ShellEditViewSessionScriptsProfilesWindow iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKER881DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:31181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17189
|
|
17188
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
0 results
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17188
|
|
17187
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitProletey(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsfront-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht is= oauth-nrivate kevhel#Support Daily - in 1h 50 m100% C47 • Mon 11 May 13:10:23HandleHubspotRateLimitTest= custom.log= laravel.log X 4 SF [jiminny@localhost]& HS_local [jiminny@localhost]« console (PROD]* console (EUlA console [STAGING]› Q- MatchActivityCrmDataX Cc W .*C) TrackAutomated ReportGeneratedzventonp© UserAutomatedReportsController.php© PlaybackController.phpC Hubspot/Service.php©HubSpot/Service.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.phpCachedCrmServiceDecorator.php© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.phpRematchActivityOnCrmObjectDetach.php© CheckAndRetryRemoteMatch.php© MatchActivityCrmData.php© Job.phpphp_ide_helper.php©) Paginationstate.php© MatchCrmData.php© CrmObjectsResolver.php— A5 A133 X11 A Vprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam::rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):Eio 4 spaces ©...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17187
|
|
17186
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴1DEV (docker)H82allAPP (-zsh)DEV (docker)&3-zsh§ Support Daily • in 1h 50 m84-zsh100% C47 8• Mon 11 May 13:10:21181screenpipe"0 ₴6configcachecompiledeventsroutesviewsCworker-crm-update:worker-crm-update_00: stoprA.Clear Laravel logjiminny-worker-processing-2:jiminny-worker-prjiminny-worker-processing-3:jiminny-worker-prjiminny-worker-processing-4:jiminny-worker-prjiminny-worker-processing-5:jiminny-worker-prjiminny-worker-processing-delayed: jiminny-worworker-analytics:worker-analytics_00: stoppecworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stcworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppecjiminny-worker-processing-1:jiminny-worker-prartisan-schedule:artisan-schedule_00: stoppecartisan-schedule:artisan-schedule_00:startecjiminny-worker-processing-1:jiminny-worker-prjiminny-worker-processing-2:jiminny-worker-prjiminny-worker-processing-3:jiminny-worker-prClaude.app/Applications/Claude.appCleanShot X.app/Applications/CleanShot X.appMonitorControlLite.app/Applications/MonitorControlLite.appiCloud DriveOpen iCloud Drive in FinderClaude Code URL Handler.app/Users/lukas/Applications/Claude Code URL Handler.appClock.app/Applications/Clock.appShow the Clipboard / Snippet ViewerView your clipboard history in Alfred's searchable clipboard viewer.Clear Clipboard History - Last 5 minutesClear the last 5 minutes from Alfred's clipboard historyJiminny-worker-processing-4:jiminny-worker-prjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny#8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV282283₴84*5₴6$87888...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17186
|
|
17185
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitroledeyC) TrackAutomated ReportGeneratedzventonp(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsM front-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass J1minnyDebuqCommand extends Commandprivate function natelamit1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht is= oauth-nrivate kevprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam:.rindsteamla*scont10 = steam->geturmuontqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=wnlomo teeli'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):T. DeleteCrmEntitylrait.ong© Job.php85 A133 M11 ^ V 488492493502=506507508509-511Support Daily - in 1h 50 m100% C4• Mon 11 May 13:10:194 SF [jiminny@localhost]A console [STAGING]MatchActivityCrmDataCc W.*[2026-05-11 10:10:03] local.INF0: [ EsUpdateTarget ] Update single target {"tarqet":"activities" "purpose":"s2026-05-1110:10:05.1[2026-05-11 10:10:03]AsyncupdatezlasticSearch Entity added to Redis List "entitylype": "activitles", "entityld":010405,"CoL[MatchActivityCrmDatal Participants old state {"activity":610403,"participants":[{"id": 996282. "user10:10:051[2026-05-11 10:10:03] local. INF0:2026-05-1410:10:051[2026-05-11 10:10:03]Fetchina token ""soc1alAccountId":1499,"provider": "hub12026-05-1110:10:03]Soc1aLAccountService Token retrieved ""soc1alAccountId":1499"provider":"hubspot"} {"correlation id":"06C3Generating access token. {"mode"."legacv"? {"correlation id"."06c30582-f8ae-4992-aax[CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider": "hubspot", "crm_owner" :148, "team_jchProspect match Cache/ Local seareh hat t tentafzer-type", emazli, dentaftem supportestagang. Jamaлnу[Prospect match] cached empty result - no API calls, try next matching method t"identifier_type":"email",Prosoect matchi Resolved comoanv domain fromenail {"email"."[EMAIL]" "domain"."fiminnt2026-05-11 10:10:037[CrmActivityService) Email domain belongs to the team, skipping crm lookup l"activity_id":610403, "team_id"a12026-05-11[2026-05-11 10:10:03]12026-05-11 10•10•03]|local.INFO: [ EsUpdateTarget ) Update single target {"target":"activities", "purpose":"searchable-observer-update", "entilocal TNEO• | AsvnclindateFlasticSearch1 Entitv added to Redis list ("entitvTvne"."activitiec" "entitvld":610403, "coller12026-05-11 10•10•031|Succoccfullv matched CRM data "activity":610403."remote search":true,"leao 10.nUl412926-05-1110•10•03]|Stantina CRM data matchina C"activity":610400 "nemote search"-true "set confiaunatio[2026-05-11 10:10:03]local. INFO: [ EsUpdateTarget ] Update single target {"target":"activities" "purpose":"searchable-observer-update" , "entie2026-05-11 19•10-031|local TNEO• " AsvnclindateFlasticSparch1 Entitv added to Redis list ("entitvTvne".lactivitiec" "entitvtd"•61A4A0, "collo.[2026-05-11 10:10:03]PTRREAEOPTRNCTOHHGETCHMHTOEE BOTADTADATMOESTEDIADIDEAPTADINEADEATITADIENMNE E BIN TABMNEASIT MIASTM TENENIAS EA ME E IT12024-05-11 10-10-071 Tocal TNE0. [SocielAecountSonvicol Gotohina tokon ficocialAecountTdl.1200 Ipnovidonll. Hhubenotll fuconnolation #du.174he[2026-05-11 10:10:03]local.INF0: [SocialAccountServicel Token retrieved {"socialAccountId":1499 "provider":"hubspot"} {"correlation id":"76b9[2026-05-11 10:10:03] local.INF0: [EncryptedTokenManager] Generating access token.2026-05-11 10:10:05local.INF0: [Crm0wnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot" "crm_owner":148, "teaml[2026-05-11 10:10:03] local.INF0:id":610400,"team id"-e2026-05-11 10:10:05CrmActivityservice tmall domain belongs to the team2026-05-11 10-10-021|local. INF0: ProspectCache - Searching DB for2026-05-11 10:10:05local.INF0: ProspectCache - Fallback DB opportunity search {"account id":244, "contact id":4487} {[2026-05-11 10:10:03112026-05-110:10:051(2026-05-11 10:10:031•Prospect march cache local searchhat dentter ryne":"emant" "dentter":"nobnnsoniderusoe com"? sC2026-05-1010:10:03[2026-05-11 10:10:03112026-05-1110:10:031L EsUpdateTarget Update single target 1"target": "activities", "purpose": "searchable-observer-update", "entit[ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities", "entityId":610400, "coll[ EsUpdateProcessManagen 1 Finished updating entities in ES {"worken"."" "peak memory"."99.73 MB" "elapsed e10:10: 05710:10:05]Naiminny Vionsol e kommands Commande nun Memony usade hefore stactino command :"command" *"meeting-hot scheduile-[ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"8eda9250-a957-4538-bfe0-6207Jaimannv Console Commands Command• •nun Memony usage fon command «"command"«"meeting-hot:schedule-hot" "memorv12026-05-1110:10:06]12026-05-11local TNEO: Jiminnv Console Commands Command• •run Memony usade fon command "command"•"dialens-moniton-activities" "mem12026-05-1110:10:08]4684-h7d1-d059ae476bbc" "trace_id". "81ff3242-6f28-4424=12024-05-11 19:10•0911Jocal NOTTCE: Monitonina ond[2026-05-11 10:10:09]"correlation_2d":"240aab61-1709-4684-D7d1-d059a847bb*", "trace.2d" :"81Ff3242-6+28-4424-a9Local. INFO: [ EsUpdateProcessManager ] Finished updating entities in ES ("worker": '™' "peak_memory"-"99.73 MB" , "elapsed.г2024-05-1119•10-101|liminnvlConcolo| Commande| Command• •nun Memony ucade bofono ctantina command filcommandil."mailhoy•chin-licte.m[2026-05-11 10:10:10]Local.INFO: Jiminny\Console\Commands\Command: :run Memory usage for command {"command": "mailbox: skip-lists:refresh", "memoio 4 spaces...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17185
|
|
17184
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
iTerm2• 0ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKER₴1DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:18181screenpipe"#6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17184
|
|
17183
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
2/95
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
107
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:09:52] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612340,"participants":[{"id":999516,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999517,"user_id":206,"contact_id":null,"lead_id":null},{"id":999518,"user_id":null,"contact_id":null,"lead_id":null},{"id":999519,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612340,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/contact/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.25,"average_seconds_per_request":0.25} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612340,"participants_processed":4,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612340} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612340,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612340,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612339,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36}} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612339} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612339,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612339,"participants":[{"id":999514,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999515,"user_id":206,"contact_id":null,"lead_id":null},{"id":999540,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612339,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612339,"participants_processed":3,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612339} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612339,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612339,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612336,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36}} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612336} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612336,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612336,"participants":[{"id":999508,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999509,"user_id":206,"contact_id":null,"lead_id":null},{"id":999512,"user_id":null,"contact_id":null,"lead_id":null},{"id":999513,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612336,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612336,"participants_processed":4,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612336} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612336,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612336,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612183,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612183} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612183,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612183,"participants":[{"id":999227,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999228,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612183,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612183,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612183} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612183,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612183,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612182,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612182} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612182,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612182,"participants":[{"id":999225,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999226,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612182,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612182,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612182} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612182,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612182,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612181,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612181} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612181,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612181,"participants":[{"id":999223,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999224,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612181,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612181,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612181} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612181,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612181,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612180,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612180} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612180,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612180,"participants":[{"id":999221,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999222,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: ProspectCache - Searching DB for opportunity by owner {"account_id":244,"contact_id":4487,"owner_id":261} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: ProspectCache - Opportunity DB search results {"account_id":244,"contact_id":4487,"opportunity_id":299} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612180,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612180,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612180} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612180,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612180,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":611455,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89}} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":611455} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":611455,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":611455,"participants":[{"id":997961,"user_id":null,"contact_id":null,"lead_id":null},{"id":997962,"user_id":1460,"contact_id":null,"lead_id":null}]} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Failed to fetch contact {"email":"[EMAIL]","reason":"[404] Client error: `GET https://api.hubapi.com/crm/v3/objects/contacts/support%40staging.jiminny.com?properties=email%2Cfirstname%2Clastname%2Ccountry%2Cphone%2Cmobilephone%2Cjobtitle%2Chubspot_owner_id%2Cassociatedcompanyid%2Cphoto&archived=0&idProperty=email` resulted in a `404 Not Found` response"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] API returned empty result, caching the miss with empty prospect data {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/contact/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.23,"average_seconds_per_request":0.23} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Resolved company domain from email {"email":"[EMAIL]","domain":"jiminny.com"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Cache miss {"identifier_type":"domain","identifier":"jiminny.com","crm":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"domain","identifier":"jiminny.com"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [HubSpot] importAccount {"crm_provider_id":"749766179","config_id":2} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [HubSpot] CRM Search requested {"request":{"filterGroups":[{"filters":[{"propertyName":"associations.company","operator":"EQ","value":"749766179"},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedwon","4040964","59247967"]},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedlost","4040965","59247968"]}]}],"sorts":[{"propertyName":"modifieddate","direction":"DESCENDING"}],"properties":["dealname","amount","hubspot_owner_id","pipeline","dealstage","closedate","deal_currency_code"],"limit":200}} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/deals/search","total_requests":1,"total_records_fetched":10,"total_elapsed_seconds":0.23,"average_seconds_per_request":0.23} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17183
|
|
17182
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17182
|
|
17181
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelp• Support Daily - in 1h 50 mDEV (docker)DOCKER- 81DEV (docker)H82APP (-zsh)-zsh-zsh100%8• Mon 11 May 13:10:09181screenpipe"0 ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17181
|
|
17180
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Sync Changes
Hide This Notification
Code changed:
Hide
19
Previous Highlighted Error
Next Highlighted Error
[2026-05-07 14:21:15] local.INFO: [Hubspot] DEBUG Getting headers {
"headers":{
"Date":["Thu,07 May 2026 14:21:15 GMT"],
"Content-Type":["application/json;charset=utf-8"],
"Transfer-Encoding":["chunked"],
"Connection":["keep-alive"],
"CF-Ray":["9f80deb8db60dc3a-SOF"],
"CF-Cache-Status":["DYNAMIC"],
"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],
"Vary":["origin,
accept-encoding"],
"access-control-allow-credentials":["false"],
"server-timing":["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\",
cfr;desc=\"9f80deb8e7c6dc3a-IAD\""],
"x-content-type-options":["nosniff"],
"x-hubspot-correlation-id":["019e02d0-6fd8-7812-bdba-885b7ccb3ee3"],
"Set-Cookie":["__cf_bm=SIUrtdQgXVrik50pdqF6hZVYKhzTnQBidvMabeCtm0Y-1778163675-[IP_ADDRESS]-rI.ZggtDKxTge5zr8_2gbBfWMQQ.ufZEXDZyHz2mBUFdzdo2gTHEsOkXMSEShjK0hGYxNhUGM1ZoBpX7BcFZcHEjA7Cs_.SMUhUnd2nYjko; path=/; expires=Thu,
07-May-26 14:51:15 GMT; domain=.hubapi.com; HttpOnly; Secure; SameSite=None"],
"Report-To":["{
\"endpoints\":[{
\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=NYAlsVTP0fYm32qrSDjxYE4sd2RWRqiSp3wHsmdEgZlzoYdxI%2BIxVpHmsKn3O%2BKVA3mFIJ2m7YRECDGSM%2BW2IYTzo6FM4%2BdUIjURO8srzKSvJgZ%2BQ6R79arKQw3uHLlX\"}],
\"group\":\"cf-nel\",
\"max_age\":604800}"],
"NEL":["{
\"success_fraction\":0.01,
\"report_to\":\"cf-nel\",
\"max_age\":604800}"],
"Server":["cloudflare"]}} {
"correlation_id":"95236535-ec98-4541-b92a-adfa73b69eab",
"trace_id":"c7ab8365-903f-46d4-9403-0e5b551e3545"}...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17180
|
|
17179
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
2/22
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
55
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:09:52] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612340,"participants":[{"id":999516,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999517,"user_id":206,"contact_id":null,"lead_id":null},{"id":999518,"user_id":null,"contact_id":null,"lead_id":null},{"id":999519,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:52] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612340,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/contact/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.25,"average_seconds_per_request":0.25} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612340,"participants_processed":4,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612340} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612340,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612340,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"6dbaa6a0-7a77-468f-8310-4fd64558460b","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612339,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36}} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612339} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612339,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612339,"participants":[{"id":999514,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999515,"user_id":206,"contact_id":null,"lead_id":null},{"id":999540,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612339,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612339,"participants_processed":3,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612339} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612339,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612339,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"a6397e29-5807-4d47-b83d-e117e9348ec1","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612336,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36}} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612336} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612336,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612336,"participants":[{"id":999508,"user_id":null,"contact_id":4491,"lead_id":null},{"id":999509,"user_id":206,"contact_id":null,"lead_id":null},{"id":999512,"user_id":null,"contact_id":null,"lead_id":null},{"id":999513,"user_id":null,"contact_id":null,"lead_id":null}]} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612336,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612336,"participants_processed":4,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612336} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612336,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612336,"remote_search":true,"lead_id":null,"contact_id":4491,"account_id":243,"opportunity_id":276,"stage_id":36} {"correlation_id":"cd9a546b-9867-49ca-af07-b5c240d6c8e8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612183,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612183} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612183,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612183,"participants":[{"id":999227,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999228,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612183,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612183,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612183} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612183,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612183,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"c88c720c-e008-4dea-8e83-fc9956194b01","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612182,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612182} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612182,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612182,"participants":[{"id":999225,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999226,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612182,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612182,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612182} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612182,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612182,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"5a72f9d9-2de4-4b4b-91f3-67537dcabb18","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612181,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612181} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:53] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612181,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612181,"participants":[{"id":999223,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999224,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612181,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612181,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612181} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612181,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612181,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"a344e4a6-cc52-4016-aa62-9a941daa7cc8","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":612180,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36}} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612180} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612180,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":612180,"participants":[{"id":999221,"user_id":null,"contact_id":4487,"lead_id":null},{"id":999222,"user_id":261,"contact_id":null,"lead_id":null}]} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: ProspectCache - Searching DB for opportunity by owner {"account_id":244,"contact_id":4487,"owner_id":261} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: ProspectCache - Opportunity DB search results {"account_id":244,"contact_id":4487,"opportunity_id":299} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612180,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":612180,"participants_processed":2,"exact_matches":1,"domain_matches":0,"best_match_found":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":612180} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612180,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":612180,"remote_search":true,"lead_id":null,"contact_id":4487,"account_id":244,"opportunity_id":299,"stage_id":36} {"correlation_id":"210a7a54-5ef5-42a2-be8e-e306ba1068c6","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":611455,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89}} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":611455} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":611455,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [MatchActivityCrmData] Participants old state {"activity":611455,"participants":[{"id":997961,"user_id":null,"contact_id":null,"lead_id":null},{"id":997962,"user_id":1460,"contact_id":null,"lead_id":null}]} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:54] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Failed to fetch contact {"email":"[EMAIL]","reason":"[404] Client error: `GET https://api.hubapi.com/crm/v3/objects/contacts/support%40staging.jiminny.com?properties=email%2Cfirstname%2Clastname%2Ccountry%2Cphone%2Cmobilephone%2Cjobtitle%2Chubspot_owner_id%2Cassociatedcompanyid%2Cphoto&archived=0&idProperty=email` resulted in a `404 Not Found` response"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] API returned empty result, caching the miss with empty prospect data {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/contact/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.23,"average_seconds_per_request":0.23} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Resolved company domain from email {"email":"[EMAIL]","domain":"jiminny.com"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Cache miss {"identifier_type":"domain","identifier":"jiminny.com","crm":"hubspot"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"domain","identifier":"jiminny.com"} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [HubSpot] importAccount {"crm_provider_id":"749766179","config_id":2} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [HubSpot] CRM Search requested {"request":{"filterGroups":[{"filters":[{"propertyName":"associations.company","operator":"EQ","value":"749766179"},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedwon","4040964","59247967"]},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedlost","4040965","59247968"]}]}],"sorts":[{"propertyName":"modifieddate","direction":"DESCENDING"}],"properties":["dealname","amount","hubspot_owner_id","pipeline","dealstage","closedate","deal_currency_code"],"limit":200}} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:55] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/deals/search","total_requests":1,"total_records_fetched":10,"total_elapsed_seconds":0.23,"average_seconds_per_request":0.23} {"correlation_id":"bcacea27-b755-4676-833c-8a2d6e6c2827","trace_id":"69670214-d39e-46...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17179
|
|
17178
|
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitProleteyC) TrackAutomated ReportGeneratedzventonp(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsfront-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht isprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam::rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatcho..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJob::drspatchSactivity->qetidob:Sthis->infod strina: "Done."):© PlaybackController.phpC) Hubspot/Service.php© HubSpot/Service.phpCachedcmmservicebecorator.pnp© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.phpRematchActivityOnCrmObjectDetach.phpC) CheckAndRetrvRemoteMatch.pnp© MatchActivityCrmData.php© Job.phppnp_ide._nelper.phg© MatchCrmData.php© CrmObjectsResolver.phpm 45 A133 M11 ^# Support Daily - in 1h 51 m100% C49. Mon 11 May 13:09:59HandleHubsnotPatel.imitTect= custom.log X = laravel.log XASF [iiminnv@localhostl# HS local fliminnv@localhosticonsole [PRODconsole [FulA console [STAGING]Q- MatchActivityCrmDataCc WV7 ^2026-05-11 19:09-52 Tocol. INFO:[MatchActivityCrmData] Participants old state {"activity":612340, "participants": [{"id":999516,"user_id" :null,2026-05-11 19:09-521•Social AccountService_Eetchino tokensocial Account"1499 "neowider" e "hubsnot"? "corellation id"* "6dhaas2026-05-11 10-09•52]|SocialAccountServicel Token retrieved "socialAccountld"• 1499 "nroviden","hubsnot", "cornelation id"."6dhas2026-05-11 10:09•52]|Zocol WNEO. EncovntedTokenManader Genenating access token. : "mode"."lenacy"} "coccelation id"• "6dbaa6a0-7a77-468f-831C[2026-05-11 10:09•521Zocal WNS0. ComOwnenResolver Inteocation owner matched as CRM Ownen :l"com noowiden"« "hubsnot" "com ownen" 148 "team id!1206 05-11 10 094521 B00EWE Prosneat match Pache Blocal seanch hift widentatfien tyne" * "emarh" sidentaEfien" - hocenchodomaii lcom" loor[2026-05-11 10:09:52] local.INF0: [CrmActivityService) Email domain belongs to the team, skipping crm lookup {"activity_id":612340,"team_id":2,EWN Windsurf TeamsOUTEeAAenanee...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17178
|
|
17177
|
iTerm2• •ShellEditViewSessionScriptsProfilesWindow iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelplanl• Support Daily • in 1h 51 mDEV (docker)DOCKERDEV (docker)H82APP (-zsh)-zsh84-zsh100% <78• Mon 11 May 13:09:55181ffmpeg#6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2:jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
17177
|
|
17176
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitroledeyC) TrackAutomated ReportGeneratedzventonp(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsM front-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage>M debugbar… M frameworkv loasaitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.phpyhudspotsynestrategybase.ongT SyncCrmEntitiesTrait.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamit1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht isprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam::rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatcho..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJob::drspatchSactivity->qetidob:Sthis->infod strina: "Done."):© PlaybackController.phpC) Hubspot/Service.php© HubSpot/Service.phpCachedcmmservicebecorator.pnp© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.phpRematchActivityOnCrmObjectDetach.php© CheckAndRetryRemoteMatch.php© MatchActivityCrmData.php© Job.phppnp_ide._nelper.phg© MatchCrmData.php© CrmObjectsResolver.phpm 45 A133 M11 ^# Support Daily - in 1h 51 m100% C49. Mon 11 May 13:09:53HandleHubsnotPatel.imitTect= custom.log= laravel.log XASF [iiminnv@localhostl# HS local fliminnv@localhosti« console [PROD]dconsole [FulA console [STAGING]Q- MatchActivityCrmDataCc W *[2026-05-11 10:09:52) Local.INFO:[MatchActivityCrmData] Participants old state {"activity":612340, "participants": [{"id":999516,"user_id":null,2026-05-11 19:09-521•Social AccountService_Eetchino tokensocial Account"1499 "neowider" e "hubsnot"? "corellation id"* "6dhaas2026-05-11 10-09•52]|SocialAccountServicel Token retrieved "socialAccountld"• 1499 "nroviden","hubsnot", "cornelation id"."6dhas2026-05-11 10:09•52]|Zocol WNEO. EncovntedTokenManader Genenating access token. : "mode"."lenacy"} "coccelation id"• "6dbaa6a0-7a77-468f-831C[2026-05-11 10-09•521Zocal WNS0. ComOwnenResolver Inteocation owner matched as CRM Ownen :l"com noowiden"« "hubsnot" "com ownen" 148 "team id!1206 05-11 10 094521 B00EWE Prosneat match Pache Blocal seanch hift widentatfien tyne" * "emarh" sidentaEfien" - hocenchodomaii lcom" loor[2026-05-11 10:09:52] local.INF0: [CrmActivityService) Email domain belongs to the team, skipping crm lookup {"activity_id":612340,"team_id":2,EWN Windsurf TeamsoUTEeAAenanaea...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17176
|
|
17175
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17175
|
|
17174
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
PhostormVIewINavicareCodeLaravelFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitroledey(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsfront-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass JimnnyDebuqcommand extends commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht isWindowC) TrackAutomated ReportGeneratedzventonphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.phpCachedcmmservicebecorator.ong© ProspectCache.php(c) HubSpot/Service.onpSupport Daily - in 1h 51 m100% 2Q. Mon 11 May 13:09:50console [PRODconsole fEul& console [STAGINGIT DeleteCrmEntityTrait.php© Job.phpm A5 A133 M11 ^private function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam::rindsteamla*scont10 = steam->geturmuontiqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity)Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):E14= custom.logASF [iiminnv@localhostlMatchActivityCrmDataCcW.*[2026-05-11 10:09:48J2026-05-11 19:09:481¡MatchActivitvermlatal Startino CR data matchino "'activity":612557 "remote search"•true"set confiauratio•nensewar Esindate acdet indate na le tandet urade a cava lesuetnuenos euauseacchan le-onsenven-ndateu wen ttin2026-05-11 10:09:48]|• AsvnclndateSlasticSearch Entitv added to Redis Uist "entitvTvoe" "activities" "entitvid":612557 "collect2026-05-11 10:09:48]|[2026-05-11 10:09:481Zocol INEO. MatchActivitvComDatal Paticinants old state c"activity" 612557 "nanticinants" C"id": 999772 "usen 1d": 2061[SocialAccountServicel Fetching token {"socialAccountId"•1499 "providenl-"hubsnot"} {"correlation id". "1d053₴2026-05-11 10-09-48]|SocialAccountService Token netrieved "socialAccountId"• 1499 "nroviden" «"hubsnot"? "cornelation id":"1d053[2026-05-11 10:09:48][2026-05-11 10:09:48][EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"1d05369a-e62c-4573-8efbWhamlw.omdwner?esalwedinteacationownen [EMAIL]"•Whinhanalitoam.aument.1A8.Wtoam.rL[2026-05-11 10:09:48]Tocal TNSO.[CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":612557,"team_id":2,[2026-05-11 10:09:481[Prospect match] Cache / local search hit {"identifier type":"email" "identifier":"[EMAIL]"}[2026-05-11 10:09:481Jocal TNSO.[CrmActivityService] CRM matching completed {"activity id":612557,"participants _processed":2,"exact matches":[2026-05-11 10:09:481local.INF0: [ EsUpdateTarget ] Update single target {"target":"activities" "purpose": "searchable-observer-update" "entity[2026-05-11 10:09:4811 AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities" "entityId":612557,"collect[2026-05-11 10:09:48][MatchActivityCrmData] Successfully matched CRM data {"activity":612557,"remote search":true "lead id":null.'[2026-05-11 10:09:49][MatchActivityCrmData] Starting CRM data matching {"activity":612556,"remote search":true, "set confiquration"[2026-05-11 10:09:491local, INF0: [ EsUpdateTarget ] Uodate single target {"target"."activities" "purpose"."searchable-observer-update" "entify[2026-05-11 10:09:491Local.IN-u"[2026-05-11 10:09:491 local. INF0:[2026-05-11 10:09:491IAsyncupoarerlasccsearchenrhry added no kecs ust centrylyneacтynmes", etту сoоso соllec[MatchActivitvCrmDatal Participants old state {"activity":612556."participants":[{"id":999770. "user_id":206."SocialAccountServicel Fetchina token <"socialAccountld":1499."providen":"hubspot"{"correlation_id". "f00500)[2026-05-11 10:09:4912026-05-11 10:89:491[2026-05-11 10:09:49] Local. INFO:SocialAccountServicel Token retrieved <"socialAccountld":1499."provider":"hubspot", ""correlation_1d":"F0050[EncryptedTokenManager] Generating access token. {"mode"."legacv"? {"correlation_id"."f005002c-de4c-4fb1-8e67[CrmOwnerResolver] Integration owner matched as CRM Owner {"erm providen"-"hubspot" "crm ownen":148. "team id"2026-05-11 19:09:49Local. TNFO:enmActivityServicel Emarl domain belonos to the team skinoino com lookunClactiyity 1dr62556team 1d"12WN Windsurf Toams 16-1 TF.8 A Aenadoe...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17174
|
|
17173
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
iTerm2• •ShellEditViewSessionScriptsProfilesWindowHelplanl• Support Daily • in 1h 51 mDEV (docker)DOCKER881DEV (docker)H82APP (-zsh)-zsh84-zsh100%8• Mon 11 May 13:09:49181ffmpeg·6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2:jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny# l8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17173
|
|
17172
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
PhostormVIewINavicareCodeLaravelWindowFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitProletey(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia→ contrio→ database>M docsM front-end>D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phppnp api_vz.ongpnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage>M debugbar… M frameworkv Mloas.aitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass J1minnyDebuqCommand extends Commandprivate function natelamut1365ScrmService->syncOpportunity('374720564');ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel log< nhnunit ymus tht isC) TrackAutomated ReportGeneratedzventonp© UserAutomatedReportsController.php© PlaybackController.phpC) Hubspot/Service.php© HubSpot/Service.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.phpCachedcmmservicebecorator.pnp© ProspectCache.php© JiminnyDebugCommand.php X T DeleteCrmEntityTrait.phpRematchActivityOnCrmObjectDetach.php© CheckAndRetryRemoteMatch.php© MatchActivityCrmData.php© Job.phpphp_ide_helper.php©) Paginationstate.php© MatchCrmData.php© CrmObjectsResolver.phpm A5 A133 M11 ^# Support Daily - in 1h 51 m100% C49. Mon 11 May 13:09:47HandleHubsnotPatel.imitTect= custom.log= laravel.log X4 SF [jiminny@localhost]# HS local fliminnv@localhosticonsole [PRODconsole [FulA console [STAGING]Q- MatchActivityCrmDataCc WV7 ^2026-05-11 19:09:451nensewar EsindateProcessManadensinshed undataino entates nuse twonkenenneat memonyriesnkeMilwa lansedse2026-05-11 19:09:45onmActivityService Emar domain belonos to the team skinino com lookun Clactivity id"160562 "team 1d"1212026-05- 10 09 45 Bc0EWNEOR ComActa viltySenvicelCRM matchino comolletedWactaMity 1l612562 "nantalcinantis noocessed"* "exant matichesi12026-05-11 10209 25B0EWE0R EsindatelacoetIndate sindle tacaet "tandet" -"aotaviales" "nunnose" « "ceanchabile-obsenven-undate" "entalt[2026-05-11 10:09:45]local. TNEO.• AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":612562,"collect[2026-05-11 10:09:46] local.INF0:[MatchActivityCrmData) Successfully matched CRM data {"activity":612562,"remote_search":true,"lead_id":null,"private function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam:.rindsteamla*scont10 = steam->geturmuontqurationonSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arauts: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team_id', $teamId)->whereNotNull( columns: 'crm_provider id')IAdIN→> Umrscount)->geto"Sthis->info0 string: "Dnspatching «Sactivitres->countO Ver1fvActzvitvcrmtaskJob 100S")*Foreach Sactivities as sactivity) <Ver1fvActivitycrmtaskJob::drspatchSactivity->qetidob:Sthis->infod strina: "Done."):WN Windsurf Teamc8-1UTE.8io 4 spaces ©...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17172
|
|
17171
|
PnostormIavicatecodeFV faVsco.js?9 JY-20725-handle PnostormIavicatecodeFV faVsco.js?9 JY-20725-handle-HS-search-rate-limitProleteyc) TrackAutomatedReporiGenerateocvent.ont(C) TranscodeParameterRescl© UserService.php© Uuid.php> D TraitsD UseCases> D User> D Utils› D Validation> OvOphp nelpers.ong© InitialFrontendState.php© Jiminny.phpc) Plan.oho© Serializer.phpC) TeamScimDetails.ohpbootstrap>© build.> contia>@ contrib→ database>M docsM front-end> D lang> node_modules library rootM ohostan> M nublic>O resourcesv Mroutesphp api.phpphp api_v2.phppnp console.onopnp customer_api.onppnp embedded.ongphp nealtn.onppnp scim.onophp uprotectedweb.phpphp web.phpphp webhook.php>O scriptsv O storage•aoo>M debugbar… M frameworkv loasaitianoreê audio. wav= custom.loal© SyncRelatedActivityManager.phphudspotsynestrategybase.ongT SyncCrmEntitiesTrait.php© VerifyActivityCrmTaskJob.php© CrmActivityService.php© ProviderRateLimiter.phpclass J1minnyDebuqCommand extends Commandprivate function natelamut1365ScrmService->syncOpportunity('374720564'):ScrmService->matchByName('Robot'):369=hubsnot-iournal-noll.log= laravel logus tht isprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidsteam = leam:.rindsteamla*scont10 = steam->geturmuontiqurationorSactivities = Activity::queryo->wherel co'crm configuration id'. Sconfig->qetIdO)->orderByDesc( column: 'id')->U1m1t(Scount)->qetosSthis->info( string: "Dispatchina «Sactivities->counto* MatchActivitvermdata ñoos (portal= Sconfia->getido?"):foreach (Sactivities as Sactivitv) «MatchActivitvCrmData:disoatchd..arats: Sactivity->getId, $config, true);Sthis->info( string: 'Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.'):no usagesprivate function simulateVerifyTaskStorm(int SteamId = 2, int $count = 100): voidSactivities = Activity::queryO=walonotsell'team id', $teamId)->whereNotNull( columns: 'crm_provider id')aalnalanwwnleIAdIN→> Umrscount)->geto"Sthis->info string: "Dnspatching «Sactivitres->countO VerifvActzvitvcrmtaskJob 100S")*foreach Sactivities as sactivity) &Ver1fvActivitycrmtaskJo0::drspatchSactivity->qetido0:Sthis->infod strina: "Done."):Mon 11 маT. DeleteCrmEntitylrait.ong© Job.phpA5 4133 M11 A V= laravel.log X 4 SF [jiminny@localhost]console [PRODA console [STAGING]Q- MatchActivityCrmDataCc W.*[2026-05-11 10:09:10] local.INF0: [Prospect match] Cache miss {"identifier_type":"domain", "identifier": "Jiminny.com" , "crm": "hur a2026-05-1110:09:100Prospect match Cache miss, calling the APl ""1dentitler type": "domaln", "1dentitier":"71m1nnv.c[2026-05-1110:09:111[HubSpot] importAccount {"crm_provider id":"749766179" "dont10_1d":2r ""correlation_1d":"62eb150d10:09:111[2026-05-11 10:09:11] Local. INFOHubspot CrM Search requested ""request":""t1lterbroups": ""t1lters": ""propertyname":"assoc1ations.companHubspot. Paqination completed "team_1d":2."endpo1nt":"https:/ap1.hubap1.com/crm/vs/ob7ects/deals/searc.2026-05-1410:0911121•CrmActzvitvServicel Emar domain belonas to the team. sklooino crm lookuo "activity 1d":615092."team 1d"*[2026-05-11 10:09:12]•CrmActivitvServicel CRM matchina comoleted "activity 1d":615092."oartacipants orocessed"*2."exact matche2026-05-11(2026-05-112026-05-1110:09:121110:09:12]LocaL. INFO:10: 09: 1211Local.INFO: L EsUpdateTarget J Update single target {"target":"activities", "purpose":"searchable-observer-update", "entAsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities", "entityId":615092, "colledSuccessfully matched CRM data "activitv":615092."remote search":true."leadid":nulm[2026-05-11 10:09:12]Local. INFO:MatchActivityCrmData) Starting CRM data matching t"activity":614436,"remote_search":true,"set_configuratio2026-05-1110: 09: 1211LocaL, INFO: EsUodateTarget Vodate sinale target «"target"."activities" "ouroose"*"searchable-observer-uodate" "ent[2026-05-11 10:09:12]ocar. TNSO.• AsyncUpdateElasticSearch ] Entity added to Redis list l'entityType":"activitiesentityld":614436,"colloe12926-05-1110•09•121|[2026-05-11 10:09:12]local.INF0: Jiminny \Console\Commands\Command::run Memory usage before starting command {"12926-05-1110•09•121|nplation idi."a70[2026-05-11 10:09:12]Tocal TNEO•SocialAccoun+Service Token notrieved ¿isocialAd} {"correlation_id":"a7972926-05-1119•99•121|79704dh-8oh7-48of-ahd[2026-05-11 10:09:12]local.INFO: [Crm0wnerResolver) Integration owner matched as CRM Owner {"cranovidonll.llbubenotl lonm ownonll.128 Itoam an12024-05-1119-90-121email"."identifier":"nikolay.nikolov@jiminny.n[2026-05-11 10:09:12]Local. Inru.rrospect macchtry next matching method ("identifier_type":"email","idг2024-05-1110:09:121[2026-05-11 10:09:12]onNseamraurvtonvinoemea domarnnolonneskipping crm lookup {"activity id":614436,"team_id".?[2026-05-11 10:09:12]fenmActivi+vConvicol CPM matchind[2026-05-11 10:09:12]" "entFe2026-05-11 10:09:122026-05-11 10:09:121[MatchActivityC[2026-05-1110:09111212026-05-1410:0911121nuatal startino uRiiauration[2026-05-11"enti12026-05-1110:09:1212026-05-1410:09:1211•SocialAccountService Fetchina tokenrelation id". "9990a10: 09-12112026-05-11Cache local search hit s"identifien tvne(2026-05-1110:09:12]Zocal. TNEO.12026-05-1110•09•121|tny next matchina method "identifien tvne[2026-05-11 10:09:12]ocal. TNEO.[CrmActivityService) Email domain belongs to the team, skipping crm lookup {"activity_id":614382,"team_id":212024-05-11 19-90.1211local.INFO: [CrmActivityService] CRM matching completed {"activity_id":614382,"participants_proces[2026-05-11 10:09:12] Local.INFO: [ EsUpdateTarget ] Update single target {"target":"activitadata" "ontfг2024-05-1119•90.121Hontitvtdll:41/302 Hco11aг2024-05-11 19-90-121Tocal TNEO.ch": true."lead id":null.г2024-95-1119-90.121[2026-05-11 10:09:13]Local. INFD: (MatchActivityCrmbata) Starting CRM data matchãng ("activity":614381, "remote _search"; true, "set.configurationlocal.INFO: [ EsUpdateTarget ] Update single target {"target":"activities" "purpose": "searchable-observer-г2024-05-11 19-90-131local. INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities", "entityId":614381, "colleeToAnt TACO.[MatchActivityCrmDatal Participants old state {"activity":614381,"participants":[{"id":1002630,"user id":nul[2026-05-11 10:09:13]49.00.11nnolotion idu.lolth...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17171
|
|
17170
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17170
|
|
17169
|
iTerm2•ShellEditViewSessionScriptsProfilesWindowHe iTerm2•ShellEditViewSessionScriptsProfilesWindowHelpaho)Support Daily - in 1h 51 mDOCKERDEV (docker)H82APP (-zsh)DEV (docker)*3-zsh-zsh100% <478 • Mon 11 May 13:09:41181screenpipe"O ₴6configcachecompiledeventsroutesviewsworker-crm-update:worker-crm-update_00: stoppedjiminny-worker-processing-2: jiminny-worker-processing-2_00:stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00: stoppedworker:worker_00: stoppedworker-audio:worker-audio_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00: stoppedworker-es-update:worker-es-update_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedartisan-schedule:artisan-schedule_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00:startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00:startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00:startedroot@docker_lamp_1:/home/jiminny#8856.34ms DONE11.98ms DONE2.10ms DONE5.31ms DONE2.90ms DONE13.11ms DONEDEV...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17169
|
|
17168
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
HubSpot\Client\Crm\Deals\ApiException
[429] Client error: `GET [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.49ms DONE
cache [PASSWORD_DOTS] 21.31ms DONE
compiled [PASSWORD_DOTS] 3.11ms DONE
events [PASSWORD_DOTS] 5.05ms DONE
routes [PASSWORD_DOTS] 1.83ms DONE
views [PASSWORD_DOTS] 4.91ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 37.77ms DONE
cache [PASSWORD_DOTS] 58.83ms DONE
compiled [PASSWORD_DOTS] 9.93ms DONE
events [PASSWORD_DOTS] 12.23ms DONE
routes [PASSWORD_DOTS] 5.02ms DONE
views [PASSWORD_DOTS] 21.46ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.01ms DONE
cache [PASSWORD_DOTS] 16.11ms DONE
compiled [PASSWORD_DOTS] 2.91ms DONE
events [PASSWORD_DOTS] 2.27ms DONE
routes [PASSWORD_DOTS] 3.11ms DONE
views [PASSWORD_DOTS] 18.41ms DONE
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
SevenShores\Hubspot\Exceptions\BadRequest
Client error: `POST [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 55.84ms DONE
cache [PASSWORD_DOTS] 108.68ms DONE
compiled [PASSWORD_DOTS] 22.07ms DONE
events [PASSWORD_DOTS] 25.86ms DONE
routes [PASSWORD_DOTS] 19.91ms DONE
views [PASSWORD_DOTS] 52.25ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-audio:worker-audio_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
TypeError
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(): Return value must be of type Generator, none returned
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:83
79▕
80▕ // Update reference parameters
81▕ $total = $state->total;
82▕ $lastRecordId = $state->lastRecordId;
➜ 83▕ }
84▕
85▕ private function shouldStopPagination(PaginationState $state, int $teamId): bool
86▕ {
87▕ if ($state->hasReachedSafetyLimit()) {
1 app/Services/Crm/Hubspot/Client.php:195
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(Object(Jiminny\Services\Crm\Hubspot\Client), [], "contact")
2 app/Services/Crm/Hubspot/Client.php:176
Jiminny\Services\Crm\Hubspot\Client::getPaginatedDataGenerator([], "contact")
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.73ms DONE
cache [PASSWORD_DOTS] 19.13ms DONE
compiled [PASSWORD_DOTS] 4.93ms DONE
events [PASSWORD_DOTS] 3.02ms DONE
routes [PASSWORD_DOTS] 5.55ms DONE
views [PASSWORD_DOTS] 6.02ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.47ms DONE
cache [PASSWORD_DOTS] 16.66ms DONE
compiled [PASSWORD_DOTS] 3.26ms DONE
events [PASSWORD_DOTS] 3.99ms DONE
routes [PASSWORD_DOTS] 3.85ms DONE
views [PASSWORD_DOTS] 4.93ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.42ms DONE
cache [PASSWORD_DOTS] 23.70ms DONE
compiled [PASSWORD_DOTS] 3.46ms DONE
events [PASSWORD_DOTS] 4.30ms DONE
routes [PASSWORD_DOTS] 8.35ms DONE
views [PASSWORD_DOTS] 8.00ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.77ms DONE
cache [PASSWORD_DOTS] 25.55ms DONE
compiled [PASSWORD_DOTS] 3.87ms DONE
events [PASSWORD_DOTS] 4.96ms DONE
routes [PASSWORD_DOTS] 2.23ms DONE
views [PASSWORD_DOTS] 7.50ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
root@docker_lamp_1:/home/jiminny#
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug 007d5da3af66
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ git status
On branch JY-20725-handle-HS-search-rate-limit
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: app/Jobs/Middleware/HandleHubspotRateLimit.php
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .env.local
modified: app/Console/Commands/JiminnyDebugCommand.php
modified: app/Exceptions/RateLimitException.php
modified: app/Jobs/Activity/Import/MatchCrmData.php
modified: app/Jobs/Crm/MatchActivityCrmData.php
modified: app/Services/Crm/Hubspot/Client.php
modified: app/Services/Crm/Hubspot/HubspotClientInterface.php
modified: app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php
modified: app/Services/Crm/Hubspot/Pagination/PaginationState.php
modified: app/Services/Crm/Hubspot/Service.php
modified: config/logging.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.env.local.bak
.env.nikilocal
.env.other
WEBHOOK_FILTERING_IMPLEMENTATION.md
app/Console/Commands/Crm/Hubspot/SimulateWebhooksCommand.php
app/Console/Commands/Reports/CreateMockAskJiminnyReportResultCommand.php
ids.txt
public/favicon.ico
raw_sql_query.sql
tests/Unit/Policies/CanAccessAiReportsTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ gbr
* JY-20725-handle-HS-search-rate-limit
master
JY-20818-move-AJ-reports-to-separated-datadog-metric
JY-20773-fix-automated-reports-user-pilot-tracking
JY-20157-AJ-report-not-send-notification
JY-20508-notify-before-AJ-report-expiration
JY-20372-ai-reports-promotion-pages
JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
JY-20738-debug-AJ-tracking-UP
a
JY-18909-automated-reports-ask-jiminny
JY-20692-fix-integration-app-[API_KEY]
JY-20553-debug-crm-sync-delays
JY-20698-fix-SF-activity-types-on-new-playbook
JY-20543-AJ-report-tracking
JY-20384-handle-auto-sync-with-no-access-to-event-type
JY-20458-ask-jiminny-user-definitions
JY-19666-fix-import-contacts-account-association
JY-19666-HS-import-contacts-and-accounts-batch-job
JY-20458-Ask-Jiminny-Reports
JY-20200-batch-update-CRM-objects-Salesforce
JY-19666-HS-webhooks-add-contact-and-company
JY-20348-trigger-setup-DI-layout-on-team-creation
JY-20326-refactor-info-message-in-command
JY-20317-fix-auto-log-delay-issue-on-all-channels-disabled
JY-20312-remove-on-update-change-last-synced-at-crm-configurations
JY-20306-SF-skip-auto-sync-for-task-based-playbook
JY-20192-remove-deleted-team-from-saved-search-filters
JY-20197-import-opportunity-batch-job
JY-20293-enable-status-field-for-pipedrive-deals
JY-20191-remove-commands-interactive-prompts
JY-20118-change-default-sync-strategy
JY-20183-add-cache-on-auto-log-delay
JY-20197-add-import-opportunity-batch-job
20118-hs-opportunity-make-webhook-strategy-default
JY-20118-make-default-hs-opportunity-sync-strategy-webhook-based
JY-20196-handle-opportunity-without-note
JY-20118-improve-opportunity-import
JY-20189-handle-activity-search-on-deleted-groups
JY-20160
JY-20145-filter-out-converted-leads-when-matching
JY-20150-skip-push-summary-on-summary-ready-if-autolog
JY-20132-fix-note-encoding
JY-19792-clean-logs
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ dev
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'team_id' in 'WHERE' (Connection: mysql, Host: mariadb, Port: 3306, Database: jiminny, SQL: select * from `activities` where `team_id` = 2 and `activities`.`deleted_at` is null order by `id` desc limit 100)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:838
834▕ $exceptionType = $this->isUniqueConstraintError($e)
835▕ ? UniqueConstraintViolationException::class
836▕ : QueryException::class;
837▕
➜ 838▕ throw new $exceptionType(
839▕ $this->getNameWithReadWriteType(),
840▕ $query,
841▕ $this->prepareBindings($bindings),
842▕ $e,
+11 vendor frames
12 app/Console/Commands/JiminnyDebugCommand.php:380
Illuminate\Database\Eloquent\Builder::get()
13 app/Console/Commands/JiminnyDebugCommand.php:49
Jiminny\Console\Commands\JiminnyDebugCommand::simulateMatchActivityStorm()
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.01ms DONE
cache [PASSWORD_DOTS] 38.00ms DONE
compiled [PASSWORD_DOTS] 1.78ms DONE
events [PASSWORD_DOTS] 1.13ms DONE
routes [PASSWORD_DOTS] 1.56ms DONE
views [PASSWORD_DOTS] 3.25ms DONE
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-audio:worker-audio_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
17168
|
|
17167
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpld6]& Support Daily - in 1h 51 mDOCKER881DEV (docker)H82APP (-zsh)DEV (docker)X3-zsh84-zsh100%8• Mon 11 May 13:09:18181screenpipe"0 ₴68853.25ms DONEviewsjiminny-worker-processing-2:jiminny-worker-processing-2_00: stoppedjiminny-worker-processing-3:jiminny-worker-processing-3_00: stoppedjiminny-worker-processing-4:jiminny-worker-processing-4_00: stoppedjiminny-worker-processing-5:jiminny-worker-processing-5_00: stoppedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00:stoppedworker-audio:worker-audio_00: stoppedworker-nudges:worker-nudges_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker:worker_00:stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3: jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:j1minny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00: startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny#php artisan jiminny: debugDispatching 100 MatchActivityCrmData jobs (portal=2)Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.root@docker_lamp_1:/home/jiminny#php artisan jiminny: debugDispatching 100 MatchActivityCrmData jobs (portal=2)Done.Watch logs and run jiminny:debug observeRateLimit to inspect cache state.root@docker_lamp_1:/home/jiminny# ]DEV...
|
iTerm2
|
DEV (docker)
|
NULL
|
17167
|
|
17166
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
HubSpot\Client\Crm\Deals\ApiException
[429] Client error: `GET [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.49ms DONE
cache [PASSWORD_DOTS] 21.31ms DONE
compiled [PASSWORD_DOTS] 3.11ms DONE
events [PASSWORD_DOTS] 5.05ms DONE
routes [PASSWORD_DOTS] 1.83ms DONE
views [PASSWORD_DOTS] 4.91ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 37.77ms DONE
cache [PASSWORD_DOTS] 58.83ms DONE
compiled [PASSWORD_DOTS] 9.93ms DONE
events [PASSWORD_DOTS] 12.23ms DONE
routes [PASSWORD_DOTS] 5.02ms DONE
views [PASSWORD_DOTS] 21.46ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.01ms DONE
cache [PASSWORD_DOTS] 16.11ms DONE
compiled [PASSWORD_DOTS] 2.91ms DONE
events [PASSWORD_DOTS] 2.27ms DONE
routes [PASSWORD_DOTS] 3.11ms DONE
views [PASSWORD_DOTS] 18.41ms DONE
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
SevenShores\Hubspot\Exceptions\BadRequest
Client error: `POST [URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 55.84ms DONE
cache [PASSWORD_DOTS] 108.68ms DONE
compiled [PASSWORD_DOTS] 22.07ms DONE
events [PASSWORD_DOTS] 25.86ms DONE
routes [PASSWORD_DOTS] 19.91ms DONE
views [PASSWORD_DOTS] 52.25ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-audio:worker-audio_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
TypeError
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(): Return value must be of type Generator, none returned
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:83
79▕
80▕ // Update reference parameters
81▕ $total = $state->total;
82▕ $lastRecordId = $state->lastRecordId;
➜ 83▕ }
84▕
85▕ private function shouldStopPagination(PaginationState $state, int $teamId): bool
86▕ {
87▕ if ($state->hasReachedSafetyLimit()) {
1 app/Services/Crm/Hubspot/Client.php:195
Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService::getPaginatedDataGenerator(Object(Jiminny\Services\Crm\Hubspot\Client), [], "contact")
2 app/Services/Crm/Hubspot/Client.php:176
Jiminny\Services\Crm\Hubspot\Client::getPaginatedDataGenerator([], "contact")
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.73ms DONE
cache [PASSWORD_DOTS] 19.13ms DONE
compiled [PASSWORD_DOTS] 4.93ms DONE
events [PASSWORD_DOTS] 3.02ms DONE
routes [PASSWORD_DOTS] 5.55ms DONE
views [PASSWORD_DOTS] 6.02ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.47ms DONE
cache [PASSWORD_DOTS] 16.66ms DONE
compiled [PASSWORD_DOTS] 3.26ms DONE
events [PASSWORD_DOTS] 3.99ms DONE
routes [PASSWORD_DOTS] 3.85ms DONE
views [PASSWORD_DOTS] 4.93ms DONE
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 14.42ms DONE
cache [PASSWORD_DOTS] 23.70ms DONE
compiled [PASSWORD_DOTS] 3.46ms DONE
events [PASSWORD_DOTS] 4.30ms DONE
routes [PASSWORD_DOTS] 8.35ms DONE
views [PASSWORD_DOTS] 8.00ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-crm-update:worker-crm-update_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
Matching contact 3
Matching contact 4
Matching contact 5
Matching contact 6
Matching contact 7
Matching contact 8
Matching contact 9
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Jiminny\Exceptions\RateLimitException
Hubspot returned 429
at app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:206
202▕ 'retry_after' => $retryAfter,
203▕ 'reason' => $e->getMessage(),
204▕ ]);
205▕
➜ 206▕ throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
207▕ } else {
208▕ throw $e;
209▕ }
210▕ }
+14 vendor frames
15 app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php:166
SevenShores\Hubspot\Http\Client::request("POST", "[URL_WITH_CREDENTIALS] php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 6.77ms DONE
cache [PASSWORD_DOTS] 25.55ms DONE
compiled [PASSWORD_DOTS] 3.87ms DONE
events [PASSWORD_DOTS] 4.96ms DONE
routes [PASSWORD_DOTS] 2.23ms DONE
views [PASSWORD_DOTS] 7.50ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-nudges:worker-nudges_00: stopped
worker-conferences:worker-conferences_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-audio:worker-audio_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Matching contact 0
Matching contact 1
Matching contact 2
root@docker_lamp_1:/home/jiminny#
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug 007d5da3af66
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ git status
On branch JY-20725-handle-HS-search-rate-limit
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: app/Jobs/Middleware/HandleHubspotRateLimit.php
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .env.local
modified: app/Console/Commands/JiminnyDebugCommand.php
modified: app/Exceptions/RateLimitException.php
modified: app/Jobs/Activity/Import/MatchCrmData.php
modified: app/Jobs/Crm/MatchActivityCrmData.php
modified: app/Services/Crm/Hubspot/Client.php
modified: app/Services/Crm/Hubspot/HubspotClientInterface.php
modified: app/Services/Crm/Hubspot/Pagination/HubspotPaginationService.php
modified: app/Services/Crm/Hubspot/Pagination/PaginationState.php
modified: app/Services/Crm/Hubspot/Service.php
modified: config/logging.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.env.local.bak
.env.nikilocal
.env.other
WEBHOOK_FILTERING_IMPLEMENTATION.md
app/Console/Commands/Crm/Hubspot/SimulateWebhooksCommand.php
app/Console/Commands/Reports/CreateMockAskJiminnyReportResultCommand.php
ids.txt
public/favicon.ico
raw_sql_query.sql
tests/Unit/Policies/CanAccessAiReportsTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ gbr
* JY-20725-handle-HS-search-rate-limit
master
JY-20818-move-AJ-reports-to-separated-datadog-metric
JY-20773-fix-automated-reports-user-pilot-tracking
JY-20157-AJ-report-not-send-notification
JY-20508-notify-before-AJ-report-expiration
JY-20372-ai-reports-promotion-pages
JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
JY-20738-debug-AJ-tracking-UP
a
JY-18909-automated-reports-ask-jiminny
JY-20692-fix-integration-app-[API_KEY]
JY-20553-debug-crm-sync-delays
JY-20698-fix-SF-activity-types-on-new-playbook
JY-20543-AJ-report-tracking
JY-20384-handle-auto-sync-with-no-access-to-event-type
JY-20458-ask-jiminny-user-definitions
JY-19666-fix-import-contacts-account-association
JY-19666-HS-import-contacts-and-accounts-batch-job
JY-20458-Ask-Jiminny-Reports
JY-20200-batch-update-CRM-objects-Salesforce
JY-19666-HS-webhooks-add-contact-and-company
JY-20348-trigger-setup-DI-layout-on-team-creation
JY-20326-refactor-info-message-in-command
JY-20317-fix-auto-log-delay-issue-on-all-channels-disabled
JY-20312-remove-on-update-change-last-synced-at-crm-configurations
JY-20306-SF-skip-auto-sync-for-task-based-playbook
JY-20192-remove-deleted-team-from-saved-search-filters
JY-20197-import-opportunity-batch-job
JY-20293-enable-status-field-for-pipedrive-deals
JY-20191-remove-commands-interactive-prompts
JY-20118-change-default-sync-strategy
JY-20183-add-cache-on-auto-log-delay
JY-20197-add-import-opportunity-batch-job
20118-hs-opportunity-make-webhook-strategy-default
JY-20118-make-default-hs-opportunity-sync-strategy-webhook-based
JY-20196-handle-opportunity-without-note
JY-20118-improve-opportunity-import
JY-20189-handle-activity-search-on-deleted-groups
JY-20160
JY-20145-filter-out-converted-leads-when-matching
JY-20150-skip-push-summary-on-summary-ready-if-autolog
JY-20132-fix-note-encoding
JY-19792-clean-logs
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ dev
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'team_id' in 'WHERE' (Connection: mysql, Host: mariadb, Port: 3306, Database: jiminny, SQL: select * from `activities` where `team_id` = 2 and `activities`.`deleted_at` is null order by `id` desc limit 100)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:838
834▕ $exceptionType = $this->isUniqueConstraintError($e)
835▕ ? UniqueConstraintViolationException::class
836▕ : QueryException::class;
837▕
➜ 838▕ throw new $exceptionType(
839▕ $this->getNameWithReadWriteType(),
840▕ $query,
841▕ $this->prepareBindings($bindings),
842▕ $e,
+11 vendor frames
12 app/Console/Commands/JiminnyDebugCommand.php:380
Illuminate\Database\Eloquent\Builder::get()
13 app/Console/Commands/JiminnyDebugCommand.php:49
Jiminny\Console\Commands\JiminnyDebugCommand::simulateMatchActivityStorm()
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 10.01ms DONE
cache [PASSWORD_DOTS] 38.00ms DONE
compiled [PASSWORD_DOTS] 1.78ms DONE
events [PASSWORD_DOTS] 1.13ms DONE
routes [PASSWORD_DOTS] 1.56ms DONE
views [PASSWORD_DOTS] 3.25ms DONE
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-download:worker-download_00: stopped
worker-audio:worker-audio_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Dispatching 100 MatchActivityCrmData jobs (portal=2)
Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
17166
|
|
17165
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
5
133
11
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Console\Commands;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use InvalidArgumentException;
use Jiminny\Jobs\AutomatedReports\RequestGenerateAskJiminnyReportJob;
use Jiminny\Jobs\AutomatedReports\SendReportMailJob;
use Jiminny\Jobs\Crm\Delete\VerifyActivityCrmTaskJob;
use Jiminny\Jobs\Crm\MatchActivityCrmData;
use Jiminny\Jobs\JobDispatcherInterface;
use Jiminny\Models\Activity;
use Jiminny\Models\AutomatedReport;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Repositories\AutomatedReportsRepository;
use Jiminny\Services\Activity\CrmOwnerResolver;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Jiminny\Services\UserPilot\UserPilotClient;
/**
* Class JiminnyDebugCommand
*
* @package Jiminny\Console\Commands
*/
class JiminnyDebugCommand extends Command
{
public const string FREQUENCY_DAILY = 'daily';
public const string FREQUENCY_WEEKLY = 'weekly';
public const string FREQUENCY_MONTHLY = 'monthly';
public const string FREQUENCY_QUARTERLY = 'quarterly';
public const string FREQUENCY_ONE_OFF = 'one_off';
protected $signature = 'jiminny:debug';
public function handle(
JobDispatcherInterface $jobDispatcher,
AutomatedReportsService $automatedReportsService,
AutomatedReportsRepository $automatedReportsRepository,
UserPilotClient $userPilotClient
): void {
// Choose ONE of the following to run, then comment out the others.
// 1) Dispatch a storm of MatchActivityCrmData jobs against team 2
$this->simulateMatchActivityStorm(teamId: 2, count: 100);
// 2) Dispatch a storm of VerifyActivityCrmTaskJob jobs (simulates DeleteCrmEntityTrait fan-out)
// $this->simulateVerifyTaskStorm(teamId: 2, count: 100);
// 3) Inspect Redis circuit-breaker state for the team's HubSpot portal
// $this->observeRateLimitCache(teamId: 2);
// 4) Make 3 synchronous matchByName calls (foreground, hits API directly)
// $this->rateLimit();
exit(1);
$report = AutomatedReport::find(71);
$last = AutomatedReportResult::query()
->where('report_id', $report->getId())
->whereIn('status', [AutomatedReportResult::STATUS_DEFAULT, AutomatedReportResult::STATUS_FAILED])
// ->where('reason', '!=', AutomatedReportResult::REASON_NOT_ENOUGH_ACTIVITIES)
->whereDate('created_at', CarbonImmutable::now()->toDateString())
->latest()
->first();
$this->info("Last: {$last->getId()}");
exit(1);
$user = User::find(143);
// $count = $automatedReportsRepository->countUserReports($user);
// $this->info("Count: {$count}");
// $count = $automatedReportsRepository->countAllUserReports($user);
// $this->info("All count: {$count}");
$payload = [
'report_type' => 'ask_jiminny',
'frequency' => 'weekly',
];
$userPilotClient->track($user, 'ask-jiminny-report-generated', $payload);
exit(1);
$now = Carbon::now()->subDay(1);
$this->info("Now: {$now->toDateTimeString()}");
$weekStart = Carbon::getWeekStartsAt();
$this->info("Now: {$weekStart}");
// $from = $now->copy()->previousWeekday()->startOfDay();
// $to = $now->copy()->previousWeekday()->endOfDay();
// $fromOld = $now->copy()->subWeeks(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subWeek()->startOfWeek();
// $toNew = $now->copy()->subWeek()->endOfWeek();
// $fromOld = $now->copy()->subMonths(1)->startOfDay();
// $toOld = $now->copy()->subDay()->endOfDay();
// $fromNew = $now->copy()->subMonthNoOverflow()->startOfMonth();
// $toNew = $now->copy()->subMonthNoOverflow()->endOfMonth();
$fromOld = $now->copy()->subMonths(3)->startOfDay();
$toOld = $now->copy()->subDay()->endOfDay();
$fromNew = $now->copy()->subQuarterNoOverflow()->startOfQuarter();
$toNew = $now->copy()->subQuarterNoOverflow()->endOfQuarter();
$this->info("From old: {$fromOld->toDateTimeString()}");
$this->info("To old: {$toOld->toDateTimeString()}");
$this->info("From new: {$fromNew->toDateTimeString()}");
$this->info("To new: {$toNew->toDateTimeString()}");
exit(1);
$report = AutomatedReport::find(71);
$job = new RequestGenerateAskJiminnyReportJob($report->getUuid());
$jobDispatcher->dispatch($job);
exit(1);
// $this->formatDate($jobDispatcher);
// $this->sendMail($jobDispatcher, $automatedReportsService);
// $this->crmService();
$this->getPayload($automatedReportsService);
exit(1);
}
private function crmService()
{
$activity = Activity::find(418141);
$team = Team::find(19);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
$crmService->createTranscriptNotes($activity);
}
private function sendMail(JobDispatcherInterface $jobDispatcher, AutomatedReportsService $automatedReportsService)
{
$reportUuid = '';
// $report = $automatedReportsService->getReportResult($reportUuid);
$report = AutomatedReportResult::find(275);
$validRecipients = $automatedReportsService->getValidRecipientUsers(
$report->getReport(),
includeJiminny: true,
);
$recipient = $validRecipients[0];
$fileName = $automatedReportsService->getReportFileName($report);
$typeName = $report->getReport()->getCustomName()
?? $automatedReportsService->getReportTypeName($report);
$teamsName = $automatedReportsService->getReportTeamsName($report);
$periodName = $automatedReportsService->getReportPeriodName($report);
$s3Path = $automatedReportsService->getMediaPath($report);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$fileName ' . PHP_EOL . print_r($fileName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$typeName ' . PHP_EOL . print_r($typeName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$teamsName ' . PHP_EOL . print_r($teamsName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$periodName ' . PHP_EOL . print_r($periodName, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$s3Path ' . PHP_EOL . print_r($s3Path, true));
$jobDispatcher->dispatch(
new SendReportMailJob(
reportUuid: $report->getUuid(),
s3Path: $s3Path,
recipientEmail: $recipient['email'],
recipientName: $recipient['name'] ?? null,
fileName: $fileName,
typeName: $typeName,
teamsName: $teamsName,
periodName: $periodName,
isAskJiminny: true,
)
);
exit(1);
}
private function formatDate(JobDispatcherInterface $jobDispatcher): void
{
$customName = 'Custom report name';
// $frequency = self::FREQUENCY_DAILY;
// $frequency = self::FREQUENCY_WEEKLY;
$frequency = self::FREQUENCY_MONTHLY;
// $frequency = self::FREQUENCY_QUARTERLY;
// $frequency = self::FREQUENCY_ONE_OFF;
$period = $this->calculateFromAndToDatePeriod($frequency);
$from = $period['fromDate'];
$to = $period['toDate'];
$periodName = $this->formatReportPeriodName($frequency, $from, $to);
$filenameSuffix = null;
if ($customName) {
if ($filenameSuffix) {
$customName .= " {$filenameSuffix}";
}
$result = $this->sanitizeFileName("{$customName} - {$periodName}");
}
$this->info($result);
}
public function calculateFromAndToDatePeriod(
string $frequency,
?Carbon $fromDate = null,
?Carbon $toDate = null
): array {
if ($frequency === self::FREQUENCY_ONE_OFF) {
return [
'fromDate' => $fromDate,
'toDate' => $toDate,
];
}
$now = Carbon::now();
return match ($frequency) {
self::FREQUENCY_DAILY => [
'fromDate' => $now->copy()->subDay()->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_WEEKLY => [
'fromDate' => $now->copy()->subWeeks(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_MONTHLY => [
'fromDate' => $now->copy()->subMonths(1)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
self::FREQUENCY_QUARTERLY => [
'fromDate' => $now->copy()->subMonths(3)->startOfDay(),
'toDate' => $now->copy()->subDay()->endOfDay(),
],
default => throw new InvalidArgumentException("Unsupported frequency: {$frequency}"),
};
}
private function formatReportPeriodName(string $frequency, Carbon $from, Carbon $to): string
{
$fromYear = $from->format('Y');
$toYear = $to->format('Y');
$differentYears = $fromYear !== $toYear;
switch ($frequency) {
case self::FREQUENCY_DAILY:
return $from->format('j M Y');
case self::FREQUENCY_QUARTERLY:
// 'Jan-Mar 2025' or 'Nov 2024-Jan 2025' if years differ
$startMonth = $from->format('M');
$endMonth = $to->copy()->subMonth();
$endMonthName = $endMonth->format('M');
$endMonthYear = $endMonth->format('Y');
if ($differentYears) {
return "{$startMonth} {$fromYear} - {$endMonthName} {$endMonthYear}";
}
return "{$startMonth} - {$endMonthName} {$toYear}";
case self::FREQUENCY_MONTHLY:
// 'May 2025' - monthly reports are always within the same year
return $from->format('M Y');
case self::FREQUENCY_WEEKLY:
// '4 - 8 Aug 2025', '27 Oct - 3 Nov 2025', or '28 Dec 2024 - 3 Jan 2025' if years differ
$startDay = $from->format('j');
$endDay = $to->format('j');
$startMonth = $from->format('M');
$endMonth = $to->format('M');
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
if ($startMonth !== $endMonth) {
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
}
return "{$startDay} - {$endDay} {$endMonth} {$toYear}";
case self::FREQUENCY_ONE_OFF:
// '2 May-31 May 2025' or '15 Dec 2024-15 Jan 2025' if years differ
$startDay = $from->format('j');
$startMonth = $from->format('M');
$endDay = $to->format('j');
$endMonth = $to->format('M');
// If same month and year, use a format like '2-31 May 2025'
if ($startMonth === $endMonth && ! $differentYears) {
return "{$startDay} - {$endDay} {$startMonth} {$toYear}";
}
// If different years, include both years
if ($differentYears) {
return "{$startDay} {$startMonth} {$fromYear} - {$endDay} {$endMonth} {$toYear}";
}
// Same year but different months
return "{$startDay} {$startMonth} - {$endDay} {$endMonth} {$toYear}";
default:
// Default format for unknown frequencies
return $from->format('j M Y') . ' - ' . $to->format('j M Y');
}
}
public function sanitizeFileName(string $fileName): string
{
return str_replace(['/', '\\'], '-', $fileName);
}
private function getPayload(AutomatedReportsService $automatedReportsService)
{
$reportResult = AutomatedReportResult::find(269);
$automatedReport = $reportResult->getReport();
$activityIds = [1,2,3];
$payload = $automatedReportsService->getAskJiminnyGenerateReportPayload(
automatedReport: $automatedReport,
reportResult: $reportResult,
activityIds: $activityIds,
);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$payload ' . PHP_EOL . print_r($payload, true));
}
private function rateLimit()
{
$team = Team::find(2);
$config = $team->getCrmConfiguration();
$crmResolver = app(CrmOwnerResolver::class, [
'team' => $team,
'integrationAdmin' => $team->getOwner(),
'providerSlug' => $config->getProviderName(),
]);
$crmService = $crmResolver->prepareCrmService();
for ($i = 0 ; $i < 3; $i++) {
// if ($i % 25 === 0) {
// $this->info("Syncing opportunity {$i}");
$this->info("Matching contact {$i}");
// }
// $crmService->syncOpportunity('374720564');
$crmService->matchByName('Robot');
}
}
private function simulateMatchActivityStorm(int $teamId = 2, int $count = 100): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$activities = Activity::query()
->where('crm_configuration_id', $config->getId())
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} MatchActivityCrmData jobs (portal={$config->getId()})");
foreach ($activities as $activity) {
MatchActivityCrmData::dispatch($activity->getId(), $config, true);
}
$this->info('Done. Watch logs and run jiminny:debug observeRateLimit to inspect cache state.');
}
private function simulateVerifyTaskStorm(int $teamId = 2, int $count = 100): void
{
$activities = Activity::query()
->where('team_id', $teamId)
->whereNotNull('crm_provider_id')
->orderByDesc('id')
->limit($count)
->get();
$this->info("Dispatching {$activities->count()} VerifyActivityCrmTaskJob jobs");
foreach ($activities as $activity) {
VerifyActivityCrmTaskJob::dispatch($activity->getId());
}
$this->info('Done.');
}
private function observeRateLimitCache(int $teamId = 2): void
{
$team = Team::find($teamId);
$config = $team->getCrmConfiguration();
$key = sprintf('hubspot:ratelimit:portal:%d', $config->getId());
$value = Redis::get($key);
$ttl = Redis::ttl($key);
$this->info("Redis key: {$key}");
$this->info('Value: ' . ($value ?? '(empty)'));
$this->info("TTL: {$ttl}s");
}
}
Show Replace Field
Search History
MatchActivityCrmData
New Line
Match Case
Words
Regex
Replace History
Replace
New Line
Preserve case
1/9
Previous Occurrence
Next Occurrence
Filter Search Results
Open in Window, Multiple Cursors
Click to highlight
Close
Sync Changes
Hide This Notification
Code changed:
Hide
50
Previous Highlighted Error
Next Highlighted Error
[2026-05-11 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"b3759be0-aa27-4c0a-9f87-1dfcf8b52f08","trace_id":"b2648550-f4d5-4b7c-a4b6-f4ade0cdfac6"}
[2026-05-11 10:09:07] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"b3759be0-aa27-4c0a-9f87-1dfcf8b52f08","trace_id":"b2648550-f4d5-4b7c-a4b6-f4ade0cdfac6"}
[2026-05-11 10:09:07] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"b3759be0-aa27-4c0a-9f87-1dfcf8b52f08","trace_id":"b2648550-f4d5-4b7c-a4b6-f4ade0cdfac6"}
[2026-05-11 10:09:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"2f78ce4e-b7b6-4b39-a19e-de1e40222762","trace_id":"85100ae0-2ad2-4b90-9dd7-c9476efd7d95"}
[2026-05-11 10:09:09] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"2f78ce4e-b7b6-4b39-a19e-de1e40222762","trace_id":"85100ae0-2ad2-4b90-9dd7-c9476efd7d95"}
[2026-05-11 10:09:10] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":615092,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89}} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":615092} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":615092,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [MatchActivityCrmData] Participants old state {"activity":615092,"participants":[{"id":1004102,"user_id":null,"contact_id":null,"lead_id":null},{"id":1004103,"user_id":89,"contact_id":null,"lead_id":null}]} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Hubspot] Failed to fetch contact {"email":"[EMAIL]","reason":"[404] Client error: `GET https://api.hubapi.com/crm/v3/objects/contacts/nikolay.nikolov%40jiminny.com?properties=email%2Cfirstname%2Clastname%2Ccountry%2Cphone%2Cmobilephone%2Cjobtitle%2Chubspot_owner_id%2Cassociatedcompanyid%2Cphoto&archived=0&idProperty=email` resulted in a `404 Not Found` response"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Prospect match] API returned empty result, caching the miss with empty prospect data {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.NOTICE: Monitoring start {"correlation_id":"27f063f5-b873-4d18-88dc-3e9b086efc4d","trace_id":"7dc8cfd2-bca6-49ac-bae0-7f8a12c74d95"}
[2026-05-11 10:09:10] local.NOTICE: Monitoring end {"correlation_id":"27f063f5-b873-4d18-88dc-3e9b086efc4d","trace_id":"7dc8cfd2-bca6-49ac-bae0-7f8a12c74d95"}
[2026-05-11 10:09:10] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/contact/search","total_requests":1,"total_records_fetched":0,"total_elapsed_seconds":0.24,"average_seconds_per_request":0.24} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Prospect match] Resolved company domain from email {"email":"[EMAIL]","domain":"jiminny.com"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Prospect match] Cache miss {"identifier_type":"domain","identifier":"jiminny.com","crm":"hubspot"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:10] local.INFO: [Prospect match] Cache miss, calling the API {"identifier_type":"domain","identifier":"jiminny.com"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:11] local.INFO: [HubSpot] importAccount {"crm_provider_id":"749766179","config_id":2} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:11] local.INFO: [HubSpot] CRM Search requested {"request":{"filterGroups":[{"filters":[{"propertyName":"associations.company","operator":"EQ","value":"749766179"},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedwon","4040964","59247967"]},{"propertyName":"dealstage","operator":"NOT_IN","values":["closedlost","4040965","59247968"]}]}],"sorts":[{"propertyName":"modifieddate","direction":"DESCENDING"}],"properties":["dealname","amount","hubspot_owner_id","pipeline","dealstage","closedate","deal_currency_code"],"limit":200}} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:11] local.INFO: [Hubspot] Pagination completed {"team_id":2,"endpoint":"https://api.hubapi.com/crm/v3/objects/deals/search","total_requests":1,"total_records_fetched":10,"total_elapsed_seconds":0.25,"average_seconds_per_request":0.25} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":615092,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":615092,"participants_processed":2,"exact_matches":0,"domain_matches":1,"best_match_found":true} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":615092} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":615092,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":615092,"remote_search":true,"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89} {"correlation_id":"62eb150d-4cb2-448d-b154-b9ceefe5538a","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":614436,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89}} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":614436} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":614436,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Participants old state {"activity":614436,"participants":[{"id":1002751,"user_id":null,"contact_id":null,"lead_id":null},{"id":1002752,"user_id":89,"contact_id":null,"lead_id":null}]} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"5e7a2b91-b3db-49ce-9522-5052e67f62b8","trace_id":"72b2a81e-013c-47a2-88b6-a74a8899a0d0"}
[2026-05-11 10:09:12] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] cached empty result - no API calls, try next matching method {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] Resolved company domain from email {"email":"[EMAIL]","domain":"jiminny.com"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":614436,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":614436,"participants_processed":2,"exact_matches":0,"domain_matches":1,"best_match_found":true} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":614436} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":614436,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":614436,"remote_search":true,"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89} {"correlation_id":"a7979fdb-8eb7-48ef-ab04-8c6d8d93caff","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":60.0,"memoryAfterCommandInMB":60.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"5e7a2b91-b3db-49ce-9522-5052e67f62b8","trace_id":"72b2a81e-013c-47a2-88b6-a74a8899a0d0"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Starting CRM data matching {"activity":614382,"remote_search":true,"set_configuration":2,"old_state":{"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89}} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":614382} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":614382,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Participants old state {"activity":614382,"participants":[{"id":1002632,"user_id":null,"contact_id":null,"lead_id":null},{"id":1002633,"user_id":89,"contact_id":null,"lead_id":null}]} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] Cache / local search hit {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] cached empty result - no API calls, try next matching method {"identifier_type":"email","identifier":"[EMAIL]"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [Prospect match] Resolved company domain from email {"email":"[EMAIL]","domain":"jiminny.com"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] Email domain belongs to the team, skipping crm lookup {"activity_id":614382,"team_id":2,"email":"[EMAIL]"} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [CrmActivityService] CRM matching completed {"activity_id":614382,"participants_processed":2,"exact_matches":0,"domain_matches":1,"best_match_found":true} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ EsUpdateTarget ] Update single target {"target":"activities","purpose":"searchable-observer-update","entityId":614382} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [ AsyncUpdateElasticSearch ] Entity added to Redis list {"entityType":"activities","entityId":614382,"collectionKey":"activities-for-update-priority","withPriority":true} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
[2026-05-11 10:09:12] local.INFO: [MatchActivityCrmData] Successfully matched CRM data {"activity":614382,"remote_search":true,"lead_id":null,"contact_id":null,"account_id":26,"opportunity_id":22,"stage_id":89} {"correlation_id":"999eb788-b67f-407d-b04e-7140cf8c8507","trace_id":"69670214-d39e-4683-84f6-2329f93dc455"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
17165
|