|
17050
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17050
|
|
17051
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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 – HandleHubspotRateLimitTest.php
|
NULL
|
17051
|
|
17052
|
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
Rerun 'PHPUnit: HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
Stop 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17052
|
|
17053
|
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
Rerun 'PHPUnit: HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
Stop 'HandleHubspotRateLimitTest'
More Actions
iTerm2•• 0ShellEditViewSessionScriptsProfilesWindowHelpla6lSupport Daily • in 2hDEV (docker)• жзDOCKER-₴81DEV (docker)882APP (-zsh)masterJY-20818-move-AJ-reports-to-separated-datadog-metricJY-20773-fix-automated-reports-user-pilot-trackingJY-20157-AJ-report-not-send-notificationJY-20508-notify-before-AJ-report-expirationJY-20372-ai-reports-promotion-pagesJY-20352-sync-opportunities-without-a-local-owner-user-id-is-nullJY-20738-debug-AJ-tracking-UPJY-18909-automated-reports-ask-jiminnyJY-20692-fix-integration-app-[API_KEY] laysJY-20698-fix-SF-activity-types-on-new-playbookJY-20543-AJ-report-trackingJY-20384-handle-auto-sync-with-no-access-to-event-typeJY-20458-ask-Jiminny-user-definitionsJY-19666-fix-import-contacts-account-associationJY-19666-HS-import-contacts-and-accounts-batch-jobJY-20458-Ask-Jiminny-ReportsJY-20200-batch-update-CRM-objects-SalesforceJY-19666-HS-webhooks-add-contact-and-companyJY-20348-trigger-setup-DI-layout-on-team-creationJY-20326-refactor-info-message-in-commandJY-20317-fix-auto-log-delay-issue-on-all-channels-disabledJY-20312-remove-on-update-change-last-synced-at-crm-configurationsJY-20306-SF-skip-auto-sync-for-task-based-playbookJY-20192-remove-deleted-team-from-saved-search-filtersJY-20197-import-opportunity-batch-jobJY-20293-enable-status-field-for-pipedrive-dealsJY-20191-remove-commands-interactive-promptsJY-20118-change-default-sync-strategyJY-20183-add-cache-on-auto-log-delayJY-20197-add-import-opportunity-batch-job20118-hs-opportunity-make-webhook-strategy-defaultJY-20118-make-default-hs-opportunity-sync-strategy-webhook-basedJY-20196-handle-opportunity-without-noteJY-20118-improve-opportunity-importJY-20189-handle-activity-search-on-deleted-groupsJY-20160JY-20145-filter-out-converted-leads-when-matchingJY-20150-skip-push-summary-on-summary-ready-1f-autologJY-20132-fix-note-encodingJY-19792-clean-logslukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ devroot@docker_lamp_1:/home/jiminny# ]-zsh-zsh885100%8• Mon 11 May 13:00:16181screenpipe"O 86DEV...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17053
|
|
17054
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17054
|
|
17055
|
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
Rerun 'PHPUnit: HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
Stop 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
PhostormVIewcodeFV faVsco.js°9 JY-20725-handle-HS-search-rate-Iiyroledey© UserAutomatedReportsController.phpus ttt.is© PlaybackController.php© SyncRelatedActivityManager.php= oauth-private.key= oauth-public.key= storagesupervisord.pid@ text-relay.jsonv Otests› D Feature› D Integration› D ServicesC Unit> Actions© HubspotSyncStrategyBase.php© JiminnyDebugCommand.phpT DeleteCrmEntityTrait.phg© RateLimitexception l est.php© HandleHubspotRateLimitTest.php ›© MatchActivityCrmData.php© Job.php(C) CrmActivityService.phRateLimitException.pho© HandleHubspotRateLimit.php(C) Client.phpphpidehelper.php©) PaqinationState.phoC) MatchCrmData.php(C) CrmObiectsResolver.pho(C) ProviderRateLimiter.oho(C) PacinationConfia.ohok?phpAcceptcomponenideclare(strict_types=1);ucontiquration[7 Consolenamespace Tests\Unit\Jobs \Middleware;u ContractsDomainD DTOMEnums#[CoversClass(HandleHubspotRateLimit::class)]EventsD Exceptions> M7 Crml@ EmailActivitvimportEyc18 Pclass hanolenuospockaceLimlclest excenas lescuaseprivate const int MAX_ RETRY_DELAY = 600:HandlerTest.ohoc RateLimitExcentionTesprivate const int MIN RETRY DELAY = 1;Im fixturecGuardsHolnercprivate const int JITTER SECONDS = 5:D HttpD IntegrationsD Interactionsiulnheprivate HandleHubspotRateLimit Smiddleware:26 01protected function setUp: voidk...>@ Activity> • AiAutomation>[ Audiov @ AutomatedReports© CreateResultsTest.© RequestGenerateA:C RequestGenerateRe@ SendReportExpiringC SendReport JobTesC SendReportMailJob 67@ SendReportNotGen33 MYnublic function testPassesThrouahWhenNoExcentionThrown@. voi.d...49MYnublic function testPronagatesNonRateLimitExcentions@ void....* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>public static function delayClampingProviderO: array{...}> M7 Calendan, 17 CrmM DealRisks89 >winataProviden("delavtlamninapvider')]public function testReleasesJobWithClampedDelay(int SretryAfter, int SexpectedMin, int SexpectedMa> M Mailbo»• M Middleware* @return arrau<string. arraufattemots: int. shouldLog: bool}>c Handle-ubsnotRattllM Streaming>IM Toampublic static function1todSamolir v Accept File 2+ c/X Reject File 0988+ 1 of 2 files• M TolenhanvTacts naccod. 12 (a minute aaol)|aravel.logA SF (jiminny@localhost]4 HS_local [jiminny@localhost]# console [PKOb.A console [EU]A console [STAGING][2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {"neaders".?"Date":["Thu,07 May 2026 14:21:15 GMT"]."concenc-lyoe. apolicacion/ison.charser=utt-on"Transter-Encod1nq":"chunked")."Connection": L"keep-alive"J."CF-Ray": ["9f80deb8db60dc3a-SOF"].RateLimitExceptionTest xL HandleHubspotRateLimitTest xv * Running tests..v * CLI Arguments Toctcllinitl.lohclMiddlowarolHandle-lubcnotPatol imitToct*testPassesThroughWhenNoExceptionThrown1 test passed 1 / 13 testsSo hl a# Support Daily - in 2 h100% Lz.• мon 11 May 13.00.10HandleHubspotRateLimiclestv+0 ..CascadeHubSpot Rate Limit Redocker exec docker lamp 1 redis-cli -h redis llen "queues:analytics low"docker exec docker_lamp_1 redis-cli#3. No log flood - count rate-limit lines per seconddocker exec docker_lamp_1 sh -c 'tail -n 5000 storage/logs/laravel.log | grep -c "Rate limit caught"# Expected: dozens per minute, not thousands per second# 4. No stack traces from MatchActivityCrmData::handle for rate limitslog 1 wc -1''ep -oE "attempts\":[0-9]+" | sort | uniq -c'earch endpoints. tocus vour simulation on matchBvNameobs (these are the only Sentry-visible events)Ask anvthina (84L)+ ‹> CodeClaude Onus 4.7 Medium•Reiect alllAccent alliW Windcurf Teame 14 UTF-eio 4 spaces...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17055
|
|
17056
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17056
|
|
17057
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17057
|
|
17058
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17058
|
|
17059
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17059
|
|
17060
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
APP (-zsh)...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17060
|
|
17061
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
docker exec -it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at https://docs.docker.com/go/debug-cli/
docker exec -it docker_lamp_1 supervisorctl restart all
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
artisan-schedule:artisan-schedule_00: stopped
worker-emails:worker-emails_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-conferences:worker-conferences_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
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at https://docs.docker.com/go/debug-cli/
docker exec -it docker_lamp_1 php -v
PHP 8.3.30 (cli) (built: Mar 16 2026 22:32:32) (NTS)
Copyright (c) The PHP Group
Zend En...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17061
|
|
17062
|
Last login: Thu May 7 09:44:56 on ttys007
Poetry Last login: Thu May 7 09:44:56 on ttys007
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
Poetry could not find a pyproject.toml file in /Users/lukas/jiminny/app or its parents
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20773-fix-automated-reports-user-pilot-tracking) $ git status
On branch master
Your branch is up to date with 'origin/master'.
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/Jobs/Team/SyncToIntercom.php
modified: app/Services/PlaybackService.php
modified: config/logging.php
modified: resources/views/partials/crm/push-summary/html-assembly.blade.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
.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
no changes added to commit (use "git add" and/or "git commit -a")
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 1482, done.
remote: Counting objects: 100% (481/481), done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 1482 (delta 349), reused 305 (delta 289), pack-reused 1001 (from 4)
Receiving objects: 100% (1482/1482), 1017.97 KiB | 1.44 MiB/s, done.
Resolving deltas: 100% (877/877), completed with 96 local objects.
From github.com:jiminny/app
83b628967a..ad2ce76737 master -> origin/master
1ee8cbcb7b..14f54b5be2 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
5662c3b32f..b167b19973 JY-20289-api-tests -> origin/JY-20289-api-tests
b40408cfad..f23cfee7c3 JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
* [new branch] JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20662-remove-word-boost -> origin/JY-20662-remove-word-boost
* [new branch] JY-20742-mcp-poc -> origin/JY-20742-mcp-poc
* [new branch] make-claude-great-again -> origin/make-claude-great-again
* [new branch] secfix/composer-20260507 -> origin/secfix/composer-20260507
* [new branch] secfix/npm-20260507 -> origin/secfix/npm-20260507
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
resources/views/partials/crm/push-summary/html-assembly.blade.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
error: Your local changes to the following files would be overwritten by merge:
app/Jobs/Team/SyncToIntercom.php
Please commit your changes or stash them before you merge.
Aborting
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
Updating 83b628967a..ad2ce76737
Fast-forward
.cursor/rules/frontend-conventions.mdc | 23 ++
.env.production-eu | 2 +-
.env.staging | 2 +-
Makefile | 10 +
app/Component/ActivityAnalytics/Service/ActivityAnalyticsService.php | 6 +-
app/Component/AiAutomation/Repositories/AiTemplateFieldsRepository.php | 32 +-
app/Component/AiCallScoring/Repositories/AiScorecardRepository.php | 56 ++--
app/Component/AskAnything/AskAnythingPromptService.php | 3 +
app/Component/Transcription/Job/FinishTranscriptionJob.php | 37 ++-
app/Component/Transcription/TranscriptionProcessor/Gong/Gong.php | 18 +-
app/Component/Twilio/Conference/ConferenceManager/SoftPhoneManager.php | 4 +-
app/Component/Twilio/Service/SoftPhoneService.php | 124 ++++---
app/Component/Twilio/TwilioRepository.php | 27 ++
app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php | 59 ----
app/Console/Commands/Reports/AutomatedReportsCommand.php | 122 +++++--
app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php | 200 ++++++++++++
app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php | 60 ----
app/Console/Commands/Users/SyncToIntercom.php | 4 +-
app/Console/Kernel.php | 3 +-
app/Contracts/ES/Events/UpdateMultipleEntities.php | 4 -
app/Contracts/ES/Events/UpdateSingleEntity.php | 4 -
app/Contracts/Repositories/TeamRepository.php | 3 +-
app/Events/Activities/ActivityUpdated.php | 10 +-
app/Events/Activities/Audio/RecordingEvent.php | 6 +-
app/Events/Activities/Softphone/Ended.php | 8 +-
app/Events/Activities/Softphone/SoftphoneEvent.php | 24 +-
app/Events/Activities/Softphone/Started.php | 8 +-
app/Http/Controllers/API/ActivityController.php | 17 +-
app/Http/Controllers/API/SoftphoneController.php | 9 +-
app/Http/Controllers/API/UserAutomatedReports/UserAutomatedReportsController.php | 19 +-
app/Http/Controllers/API/V2/AskAnythingController.php | 2 +-
app/Http/Controllers/Auth/SocialController.php | 6 +-
app/Http/Controllers/Kiosk/AutomatedReportsController.php | 38 ++-
app/Http/Controllers/Kiosk/OrganizationsController.php | 8 +-
app/Http/Controllers/Kiosk/PartnersController.php | 46 +++
app/Http/Controllers/Kiosk/SearchController.php | 8 +
app/Http/Controllers/Kiosk/Teams/OnboardController.php | 24 +-
app/Http/Controllers/Settings/Teams/IntegrationController.php | 6 +-
app/Http/Controllers/TeamSetupController.php | 4 +-
app/Http/Controllers/Telephony/TextMessaging/MessageController.php | 12 +-
app/Http/Controllers/Telephony/TextMessaging/WebhookController.php | 18 +-
app/Http/Requests/Settings/Teams/CreateTeamRequest.php | 1 +
app/Http/Requests/Settings/Teams/EditTeamRequest.php | 1 +
app/Http/Transformers/ActivityTransformer.php | 4 +-
app/Http/Transformers/OnDemandActivitiesTransformer.php | 2 +-
app/Http/Transformers/PartnerTransformer.php | 1 +
app/Http/Transformers/StageTransformer.php | 6 +-
app/Http/Transformers/UserTransformer.php | 11 +-
app/Interactions/Settings/Teams/CreateTeam.php | 3 +
app/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJob.php | 80 ++++-
app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php | 119 +++++++
app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php | 89 +++++
app/Jobs/Crm/Hubspot/ImportBatchJobTrait.php | 12 +-
app/Jobs/Crm/UpdateStage.php | 3 +
app/Jobs/Team/SyncToIntercom.php | 7 +-
app/Listeners/Teams/SyncIntercomCompany.php | 5 +-
app/Listeners/Teams/UpdateSalesforceAccount.php | 8 +-
app/Listeners/Users/SyncIntercom.php | 5 +-
app/Mail/Reports/AskJiminnyReportExpiringMail.php | 40 +++
app/Mail/Reports/ReportNotGenerated.php | 41 +++
app/Models/Activity.php | 25 +-
app/Models/Activity/Question.php | 14 +-
app/Models/Activity/Search.php | 7 +
app/Models/AskAnything/AskAnythingPrompt.php | 6 +
app/Models/AutomatedReport.php | 10 +
app/Models/CoachingFeedback.php | 44 ++-
app/Models/ElasticSearch/ActivityElasticSearchTrait.php | 86 +----
app/Models/ElasticSearch/OpportunityElasticSearchTrait.php | 71 ----
app/Models/ElasticSearch/SharedDocumentDeleteTrait.php | 27 --
app/Models/Partner.php | 13 +
app/Models/Playlist/Activity.php | 14 +-
app/Notifications/OwnerInvitedToTrial.php | 14 +-
app/Policies/UserPolicy.php | 16 +-
app/Queue/Worker/Worker.php | 3 +-
app/Repositories/ActivityRepository.php | 13 +-
app/Repositories/AutomatedReportsRepository.php | 42 ++-
app/Repositories/TeamRepository.php | 21 +-
app/Repositories/UserRepository.php | 2 +-
app/Services/Activity/MeetingBotService.php | 8 +-
app/Services/ActivityService.php | 111 ++-----
app/Services/Crm/Hubspot/Service.php | 36 +-
app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php | 2 +-
app/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityService.php | 5 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsService.php | 49 +--
app/Services/Kiosk/KioskService.php | 7 +-
app/Services/Webhook/Triggers/AiScorecardCompletedTrigger.php | 13 +-
app/UseCases/TeamInsights/ConversationRowMapper.php | 78 +++++
app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php | 68 ++++
app/UseCases/TeamInsights/StrictConsentColumnResolver.php | 45 +++
app/UseCases/TeamInsights/TeamConversationsExport.php | 154 ++++-----
composer.json | 1 -
composer.lock | 95 +-----
config/secure-headers.php | 5 +-
database/mappings/mapping_activities.json | 16 +
database/migrations/2026_04_14_000000_add_rockeed_partner.php | 51 +++
database/migrations/2026_04_22_000000_add_success_email_to_partners.php | 26 ++
database/migrations/2026_04_27_000000_add_label_to_partners.php | 28 ++
database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php | 79 +++++
front-end/package.json | 5 +-
front-end/src/__mocks__/jiminny.js | 4 +-
front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js | 9 +
front-end/src/__mocks__/setup.js | 1 +
front-end/src/apps/ai-reports-promo.js | 22 ++
front-end/src/components/AiReports/AiReportsPromo.vue | 22 ++
front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue | 190 +++++++++++
front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue | 111 +++++++
front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue | 103 ++++++
front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js | 98 ++++++
.../src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html | 283 ++++++++++++++++
front-end/src/components/AiReports/Manage/ManageAiReports.vue | 8 +-
front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue | 228 +++++++++++++
front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js | 71 ++++
.../src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html | 217 ++++++++++++
front-end/src/components/AiReports/constants.js | 7 +
front-end/src/components/Settings/Kiosk/OrganizationSearch/Organizations.vue | 1 +
front-end/src/components/Settings/Kiosk/__mocks__/Jiminny.js | 1 +
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/EditTeamModal.vue | 43 ++-
front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js | 203 ++++++++++++
front-end/src/components/Settings/Kiosk/shared/Navigation/Navigation.vue | 3 +
front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js | 67 ++++
front-end/src/components/TeamInsights/CoachingFrameworks/AICallScoring/aiCallScoringOverTime.ts | 4 +-
front-end/src/components/TeamInsights/CoachingFrameworks/UsersList.vue | 2 +-
front-end/src/components/layout/Sidebar/HelpMenu.vue | 25 +-
front-end/src/components/layout/Sidebar/Sidebar.vue | 27 +-
front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js | 94 ++++++
front-end/src/components/layout/Sidebar/__tests__/__snapshots__/Sidebar.spec.js.snap | 4 +-
front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js | 204 ++++++++++++
front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js | 49 +++
front-end/src/main.js | 1 +
front-end/src/store/modules/TeamInsights/util.js | 1 +
front-end/src/store/modules/platform/__tests__/getters.spec.js | 22 ++
front-end/src/store/modules/platform/getters.js | 3 +
front-end/src/utils/index.js | 11 +
front-end/yarn.lock | 21 +-
phpstan-baseline.neon | 60 ----
public/pdf/exec-reports/com/coaching-profiles.pdf | Bin 0 -> 1531178 bytes
public/pdf/exec-reports/com/exec-summary.pdf | Bin 0 -> 2237381 bytes
public/pdf/exec-reports/com/loss-report.pdf | Bin 0 -> 1955343 bytes
public/pdf/exec-reports/com/product-feedback.pdf | Bin 0 -> 2184417 bytes
public/pdf/exec-reports/eu/coaching-profiles.pdf | Bin 0 -> 1528704 bytes
public/pdf/exec-reports/eu/exec-summary.pdf | Bin 0 -> 2296741 bytes
public/pdf/exec-reports/eu/loss-report.pdf | Bin 0 -> 1955808 bytes
public/pdf/exec-reports/eu/product-feedback.pdf | Bin 0 -> 2184083 bytes
resources/views/emails/reports/ask-jiminny-report-expiring.blade.php | 22 ++
resources/views/emails/reports/report-not-generated.blade.php | 24 ++
resources/views/partials/crm/push-summary/html-assembly.blade.php | 2 +-
routes/api.php | 6 +
routes/web.php | 4 +
tests/Feature/Policies/UserPolicyTest.php | 90 ++++-
tests/Unit/Component/ActivityAnalytics/Service/ActivityAnalyticsServiceTest.php | 40 +++
tests/Unit/Component/AskAnything/AskAnythingPromptServiceTest.php | 26 ++
tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php | 276 ++++++++++++++++
tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php | 375 +++++++++++++++++++++
tests/Unit/Component/Twilio/Service/SoftPhoneServiceTest.php | 1014 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
tests/Unit/Console/Commands/Reports/AutomatedReportsCommandTest.php | 157 ++++++++-
tests/Unit/Events/Activities/Audio/RecordingEventTest.php | 72 ++++
tests/Unit/Events/Activities/Softphone/EndedTest.php | 86 +++++
tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php | 88 +++++
tests/Unit/Events/Activities/Softphone/StartedTest.php | 86 +++++
tests/Unit/Http/Controllers/Kiosk/AutomatedReportsControllerTest.php | 99 ++++++
tests/Unit/Http/Transformers/ActivityTransformerTest.php | 5 +-
tests/Unit/Http/Transformers/PartnerTransformerTest.php | 34 ++
tests/Unit/Interactions/Settings/Teams/CreateTeamTest.php | 49 +++
tests/Unit/Jobs/AutomatedReports/RequestGenerateAskJiminnyReportJobTest.php | 106 +++++-
tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php | 205 ++++++++++++
tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php | 188 +++++++++++
tests/Unit/Jobs/Crm/ImportOpportunityBatchTest.php | 2 +-
tests/Unit/Jobs/Team/SyncToIntercomTest.php | 6 +
tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php | 59 ++++
tests/Unit/Listeners/Teams/UpdateSalesforceAccountTest.php | 11 +-
tests/Unit/Listeners/Users/SyncIntercomTest.php | 59 ++++
tests/Unit/Mail/Reports/ReportNotGeneratedTest.php | 166 ++++++++++
tests/Unit/Models/PartnerTest.php | 28 ++
tests/Unit/Repositories/AutomatedReportsRepositoryTest.php | 68 ++++
tests/Unit/Services/Activity/MeetingBotServiceRequestRecordingToStopTest.php | 14 +-
tests/Unit/Services/ActivityServiceTest.php | 391 ++++++++++++++++++++++
tests/Unit/Services/Crm/Hubspot/ServiceResponseNormalizeTest.php | 68 ++--
tests/Unit/Services/Kiosk/AutomatedReports/AskJiminnyReportActivityServiceTest.php | 48 +--
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceActivitiesCountTest.php | 16 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceReportGenerationTest.php | 24 +-
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsServiceTest.php | 130 ++++++++
tests/Unit/Services/KioskServiceTest.php | 8 +
tests/Unit/Services/Webhook/Triggers/AiScorecardCompletedTriggerTest.php | 6 +-
tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php | 119 +++++++
tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php | 108 ++++++
tests/Unit/UseCases/TeamInsights/TeamConversationsExportTest.php | 342 ++++++++++++++-----
186 files changed, 8538 insertions(+), 1233 deletions(-)
create mode 100644 app/Component/Twilio/TwilioRepository.php
delete mode 100644 app/Console/Commands/CoachingFeedbacksUpdateEsActivities.php
create mode 100644 app/Console/Commands/RunAiCallScoringForUntypedActivitiesCommand.php
delete mode 100644 app/Console/Commands/UpdateActivitiesAverageScoreExcludingFeedbacksNotSetVisibleToAll.php
create mode 100644 app/Http/Controllers/Kiosk/PartnersController.php
create mode 100644 app/Jobs/AutomatedReports/SendReportExpiringSoonMailJob.php
create mode 100644 app/Jobs/AutomatedReports/SendReportNotGeneratedMailJob.php
create mode 100644 app/Mail/Reports/AskJiminnyReportExpiringMail.php
create mode 100644 app/Mail/Reports/ReportNotGenerated.php
delete mode 100644 app/Models/ElasticSearch/SharedDocumentDeleteTrait.php
create mode 100644 app/UseCases/TeamInsights/ConversationRowMapper.php
create mode 100644 app/UseCases/TeamInsights/RecordingOutcomeTextResolver.php
create mode 100644 app/UseCases/TeamInsights/StrictConsentColumnResolver.php
create mode 100644 database/migrations/2026_04_14_000000_add_rockeed_partner.php
create mode 100644 database/migrations/2026_04_22_000000_add_success_email_to_partners.php
create mode 100644 database/migrations/2026_04_27_000000_add_label_to_partners.php
create mode 100644 database/migrations/2026_04_29_105053_move_ask_jiminny_reports_to_grow_tier.php
create mode 100644 front-end/src/__mocks__/kit/endpoints/automated-reports-promo.js
create mode 100644 front-end/src/apps/ai-reports-promo.js
create mode 100644 front-end/src/components/AiReports/AiReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/AutomatedReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/PromoCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/WhyItMattersCard.vue
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/AutomatedReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/AutomatedReportsPromo/__tests__/__snapshots__/automated-reports-promo.output.html
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/PanoramaReportsPromo.vue
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/PanoramaReportsPromo.spec.js
create mode 100644 front-end/src/components/AiReports/PanoramaReportsPromo/__tests__/__snapshots__/panorama-reports-promo.output.html
create mode 100644 front-end/src/components/Settings/Kiosk/modals/EditTeamModal/__tests__/EditTeamModal.spec.js
create mode 100644 front-end/src/components/Settings/Kiosk/shared/Navigation/__tests__/Navigation.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/HelpMenu.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/__tests__/useAiReportsSidebarButton.spec.js
create mode 100644 front-end/src/components/layout/Sidebar/useAiReportsSidebarButton.js
create mode 100644 front-end/src/store/modules/platform/__tests__/getters.spec.js
create mode 100644 public/pdf/exec-reports/com/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/com/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/com/loss-report.pdf
create mode 100644 public/pdf/exec-reports/com/product-feedback.pdf
create mode 100644 public/pdf/exec-reports/eu/coaching-profiles.pdf
create mode 100644 public/pdf/exec-reports/eu/exec-summary.pdf
create mode 100644 public/pdf/exec-reports/eu/loss-report.pdf
create mode 100644 public/pdf/exec-reports/eu/product-feedback.pdf
create mode 100644 resources/views/emails/reports/ask-jiminny-report-expiring.blade.php
create mode 100644 resources/views/emails/reports/report-not-generated.blade.php
create mode 100644 tests/Unit/Component/Transcription/Job/FinishTranscriptionJobTest.php
create mode 100644 tests/Unit/Component/Transcription/TranscriptionProcessor/Gong/GongTest.php
create mode 100644 tests/Unit/Events/Activities/Audio/RecordingEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/EndedTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/SoftphoneEventTest.php
create mode 100644 tests/Unit/Events/Activities/Softphone/StartedTest.php
create mode 100644 tests/Unit/Http/Transformers/PartnerTransformerTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportExpiringSoonMailJobTest.php
create mode 100644 tests/Unit/Jobs/AutomatedReports/SendReportNotGeneratedMailJobTest.php
create mode 100644 tests/Unit/Listeners/Teams/SyncIntercomCompanyTest.php
create mode 100644 tests/Unit/Listeners/Users/SyncIntercomTest.php
create mode 100644 tests/Unit/Mail/Reports/ReportNotGeneratedTest.php
create mode 100644 tests/Unit/Models/PartnerTest.php
create mode 100644 tests/Unit/Services/ActivityServiceTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/RecordingOutcomeTextResolverTest.php
create mode 100644 tests/Unit/UseCases/TeamInsights/StrictConsentColumnResolverTest.php
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 628, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 628 (delta 280), reused 274 (delta 266), pack-reused 297 (from 1)
Receiving objects: 100% (628/628), 186.75 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (391/391), completed with 57 local objects.
From github.com:jiminny/app
ad2ce76737..12295204cf master -> origin/master
14f54b5be2..5e7646e5f9 JY-17836-participant-speeches-in-s3 -> origin/JY-17836-participant-speeches-in-s3
b167b19973..acba55cf38 JY-20289-api-tests -> origin/JY-20289-api-tests
f23cfee7c3..e5a3ec5dba JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null -> origin/JY-20352-sync-opportunities-without-a-local-owner-user-id-is-null
af59d60926..766efba1c5 JY-20395-fix-memory-issue-with-mail-import -> origin/JY-20395-fix-memory-issue-with-mail-import
* [new branch] JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
1737b7c528..c57e71e763 JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20671-anyvan-twilio-s3-recordings-ftech -> origin/JY-20671-anyvan-twilio-s3-recordings-ftech
+ ba181441c6...20a74137b0 JY-20742-mcp-poc -> origin/JY-20742-mcp-poc (forced update)
* [new branch] JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20816-calendar-events-diplication -> origin/JY-20816-calendar-events-diplication
* [new branch] desktop-app -> origin/desktop-app
4c4c974e46..185442c26e make-claude-great-again -> origin/make-claude-great-again
* [new branch] mcp-tools-schemas -> origin/mcp-tools-schemas
Updating ad2ce76737..12295204cf
Fast-forward
app/Component/Encoding/Job/AnalyzeTrackChannelsJob.php | 2 +-
app/Component/Transcription/TranscriptionProcessor/AssemblyAI/Services/SubmitAudioFileService.php | 66 ++----------------------------------------------------------------
app/Console/Commands/Tracks/CleanupActivityTracksCommand.php | 24 +++++++++++++++++-------
tests/Unit/Console/Commands/Tracks/CleanupActivityTracksCommandTest.php | 40 +++++++++++++++++++++++++++++-----------
tests/Unit/fixtures/assembly_ai_transcript_response.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_channel_diarization.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_error.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_not_ready.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_language_post.json | 1 -
tests/Unit/fixtures/assembly_ai_transcript_response_without_utterances.json | 1 -
11 files changed, 49 insertions(+), 90 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20818-move-AJ-reports-to-separated-datadog-metric
Switched to a new branch 'JY-20818-move-AJ-reports-to-separated-datadog-metric'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 83.615 seconds, 67.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20818-move-AJ-reports-to-separated-datadog-metric) $ csfix
docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no --diff
PHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.30
Running analysis on 7 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from ".php-cs-fixer.dist.php".
5663/5663 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Fixed 0 of 5663 files in 42.875 seconds, 60.00 MB memory used
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 15 (delta 13), reused 15 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (15/15), 1.28 KiB | 72.00 KiB/s, done.
From github.com:jiminny/app
c57e71e763..8743fea32e JY-20606-desktop-app-recall -> origin/JY-20606-desktop-app-recall
* [new branch] JY-20819-increase-download-transctip-rate-limit -> origin/JY-20819-increase-download-transctip-rate-limit
Already up to date.
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ git pull
remote: Enumerating objects: 180, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 180 (delta 127), reused 165 (delta 119), pack-reused 1 (from 1)
Receiving objects: 100% (180/180), 57.50 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (127/127), completed with 47 local objects.
From github.com:jiminny/app
12295204cf..35f036ace6 master -> origin/master
* [new branch] JY-18091-upgrade-to-php-8-5 -> origin/JY-18091-upgrade-to-php-8-5
5f21965da8..497fbc85c2 JY-20493-smart-instant-nudge-pre-filtering -> origin/JY-20493-smart-instant-nudge-pre-filtering
f029263118..6ed9e2bb13 JY-20808-low-priority-indexing-queue -> origin/JY-20808-low-priority-indexing-queue
* [new branch] JY-20817-fix-deleting-s3-directories -> origin/JY-20817-fix-deleting-s3-directories
* [new branch] JY-20820-es-reindex-stream-model-hydration -> origin/JY-20820-es-reindex-stream-model-hydration
+ ca92730ec5...2c8a1d0856 desktop-app -> origin/desktop-app (forced update)
8425d4e0de..89b45ec8b0 mcp-tools-schemas -> origin/mcp-tools-schemas
Updating 12295204cf..35f036ace6
Fast-forward
app/Component/Datadog/Constants.php | 1 +
app/Providers/RouteServiceProvider.php | 2 +-
app/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackService.php | 13 +++++++++++++
tests/Unit/Services/Kiosk/AutomatedReports/AutomatedReportsCallbackServiceTest.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 62 insertions(+), 8 deletions(-)
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ gbr
* 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
JY-20117-fix-sync-profile-fields-on-empty-fields
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20725-handle-HS-search-rate-limit
Switched to a new branch 'JY-20725-handle-HS-search-rate-limit'
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ ;xd
docker exec -it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at https://docs.docker.com/go/debug-cli/
docker exec -it docker_lamp_1 supervisorctl restart all
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
artisan-schedule:artisan-schedule_00: stopped
worker-emails:worker-emails_00: stopped
worker:worker_00: stopped
worker-calendar:worker-calendar_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-conferences:worker-conferences_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
What's next:
Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1
Learn more at https://docs.docker.com/go/debug-cli/
docker exec -it docker_lamp_1 php -v
PHP 8.3.30 (cli) (built: Mar 16 2026 22:32:32) (NTS)
Copyright (c) The PHP Group
Zend En...
|
iTerm2
|
APP (-zsh)
|
NULL
|
17062
|
|
17063
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp<lihl••APP (-zsh)83DOCKERDEV (docker)₴82APP (-zsh)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started-zshWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $|§ Support Daily - in 1h 58 mA-zsh885100% C8• Mon 11 May 13:02:11181screenpipe"O 86APP...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17063
|
|
17064
|
PnostormFV faVsco.js?9 JY-20725-handle-HS-search-r PnostormFV faVsco.js?9 JY-20725-handle-HS-search-rate-lroledey© UserAutomatedReportsController.phpus ttt.is© PlaybackController.php© SyncRelatedActivityManager.php= oauth-pnivate.key= oauth-public.key= storage= supervisord.pid@ text-relay.jsonv Otests› D Feature› D Integration› C ServicesC Unit> Actions© HubspotSyncStrategyBase.php© JiminnyDebugCommand.phpT DeleteCrmEntityTrait.php© HandleHubspotRateLimitTest.php x© MatchActivityCrmData.php© Job.php(C) CrmActivityService.phRateLimitException.pho© HandleHubspotRateLimit.php(C) Client.phpphpidehelper.php©) PaqinationState.phoC) MatchCrmData.php(C) CrmObiectsResolver.pho(C) ProviderRateLimiter.oho(C) PacinationConfia.ohoAccept Rejectcomponenideclare(strict_types=1);ucontiquration[7 Consolenamespace Tests\Unit\Jobs \Middleware;u ContractsDomainD DTOMEnums#[CoversClass(HandleHubspotRateLimit::class)]EventsD Exceptions> M7 Crml18 MVclass hanolenuospockaceLimlclest excenas lescuase) EmailActivitvimoortExclprivate const int MAX RETRY_ DELAY = 600:HandlerTest.ohoc RateLimitExcentionTesprivate const int MIN RETRY DELAY = 1;Im fixturecGuardsHolnercprivate const int JITTER SECONDS = 5:D HttpD IntegrationsD Interactionsiulnheprivate HandleHubspotRateLimit Smiddleware:26 01protected function setUp: voidk...>@ Activity> • AiAutomation>[ Audiov @ AutomatedReports© CreateResultsTest.© RequestGenerateA:C RequestGenerateRe@ SendReportExpiringC SendReport JobTesC SendReportMailJob 67@ SendReportNotGen33 MYnublic function testPassesThrouahWhenNoExcentionThrown@. voi.d...49MYnublic function testPronagatesNonRateLimitExcentions@ void....* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>public static function delayClampingProvider: array{...}> M7 CalendanwinataProviden("delavtlamninapvider')], 17 CrmM DealRisks89 >public function testReleasesJobWithClampedDelay(int SretryAfter, int SexpectedMin, int SexpectedMax): void{> M Mailbo»• M Middleware* @return arrau<string. arraufattemots: int. shouldLog: bool}>c Handle-ubsnotRattlM Streaming> IM Toampublic static function logSamolingProviderO: arrav{...}support Dally • In 1h o0m100% 12P• мon 11 May 13.02-17+0 ..=laravel.logA SF (jiminny@localhost]4 HS_local (jiminny@localhost]# console [PKOb.# console leu)# console [slAGiNg)[2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {"neaders".?"Uace":L"Inu,or May 2020 14.21.15 6Ml"Jn"Concent-lvoe". "apolicacionison charser=utt-on"Transter-Encod1nq":"chunked")."Connection": L"keep-aLive"J,"CF-Ray" : ["9f80deb8db60dc3a-SOF"],"Strict-Transport-Secur1ty":"max-aqe=31536008* 1ncLudeSubDomains: preload")n"Vary":"orioin.accent-encodino""access-control-allow-credentials": ["false"]."server-timing": ["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\","x-hubspot-correlation-id":["019e02d0-6fd8-7812-bdba-885b7ccb3ee3"],"So+-Cookie"." c+hm-Stlirtd0aXVr.kSandas6hzVVKhzTn0BidvMaheCtm0V-1778163675-1.0.107-May-26 14:51:15 GMT; domain=.hubapi.com; Http0nly; Secure; SameSite=None"],"Renont-To".r"*"endnoints"."unl".httns:a.nel.cloudflane.com./nenon+|W/v42c=NVA1cVTPQfVm32anS0ixVF/sd2RI\"group)":\"cf-nel\","max_age\":604800}"],"NEL":["{\"success_fraction\":0.01,"report to\":|"cf-nel\"."max age":604800}"]"Server": ["cloudflare"]}} {"correlation_1d":"95256555-ec78-4541-b9za-adta/Sb6Yeab"."trace_10":C/AD8565-905t-4604-9405-0e5b551e5545"CascadeHubspot Rate Limit Redocker exec docker lamp 1 redis-cli -h redis llen "queues:analytics low"docker exec docker lamp 1 redis-cli -h redis zcard "queues: analytics low: delayed'#3. No log flood - count rate-limit lines per seconddocker exec docker_lamp_1 sh -c 'tail -n 5000 storage/logs/laravel.log | grep -c "Rate limit caught"# Expected: dozens per minute, not thousands per second# 4. No stack traces from MatchActivityCrmData::handle for rate limitsdocker exec docker_lamp_1 sh =c'qrep "Falled to match CRM data" storage loas/laravel.log wC =UI# Expected: 0 during a pure rate-limit storm. Non-zero only if real bugs occur.# 5. Sampled Logging-docker exec docker_lamp_1 sh -c 'grep "Rate limit caught" storage/logs/laravel.log | grep -oE "attempts\": [0-9]+" | sort | uniq -c'# Expected: high counts for 1, 2, 3, 10. 20. 30, 40 - zero or few for 4-9, 11-19. 21-29Tuning the stormFor Postman to reliably triaaer 429s while vour jobs runi• Postman concurrency: 5-10 parallel users hitting HubSpot-touching endpoints• Job count: 50-200 is enough to see the steady state. 100k is overkill for verification.• Workers: 5-10. More workers = more visible thundering-herd-vs-cache dvnamics. HubSnot test portal: ideally use a non-production portal with low traffic so you don't burn real quota.If Postman alone can't reliably trigger 429s (HubSpot's actual portal limits are hiaher than 5 RPS for non-search endpoints), focus vour simulation on matchBvName/sparch calls — those are hound at 5 PPS ner nortal and will rate-limit fastest.SummaryFiles changed: JiminnyDebuaCommand.oho onlv. Three new private methods + handle( now picks one to run.To replicate1. Start workers2. Run Postman load alonaside3. php artisan jiminny:debug to fire the storm4. Tail logs + watch RedisHealthy sianature in loas:• A tew (Hubsnotl Received 420 lines ner cache TTl evcle (not ner secondì[HandleHubspotRateLimit] Rate limit caught only on attempts 1, 2, 3, 10, 20...• Zero [MatchActivitvCmDatal Failed to natch CRM data stack traces durina a nure rate-limit storm• After 30 min: [MatchActivityCrmData) Job permanently failed after all retries for the leftover jobs (these are the only Sentry-visible events)Oal *** Reiect alliiAccent alli/0 JiminnyDebugCommand.php +67-1/M HandleHubsootRateLimitTest.ohv +155Ask anvthina (&4L)+ « CodeClaude Onus 4.7 MediumW Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17064
|
|
17065
|
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:
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp§ Support Daily • in 1h 58 mAPP (-zsh)83DOCKERO ₴1DEV (docker)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started₴82APP (-zsh)-zsh84What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ I-zsh885100% <78• Mon 11 May 13:02:14181screenpipe"O 86APP...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17065
|
|
17066
|
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
Rerun 'PHPUnit: HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
Stop 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17066
|
|
17067
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17067
|
|
17068
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17068
|
|
17069
|
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'
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp§ Support Daily • in 1h 58 mAPP (-zsh)83DOCKERO ₴1DEV (docker)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started₴82APP (-zsh)-zsh84What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ I-zsh885100% <78• Mon 11 May 13:02:311881screenpipe"O 86APP...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17069
|
|
17070
|
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
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Exceptions;
use Exception;
use Jiminny\Exceptions\RateLimitException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
#[CoversClass(RateLimitException::class)]
class RateLimitExceptionTest extends TestCase
{
public function testConstructorWithDefaults(): void
{
$exception = new RateLimitException();
$this->assertSame('', $exception->getMessage());
$this->assertSame(1, $exception->getRetryAfter());
$this->assertNull($exception->getPrevious());
}
public function testConstructorWithCustomValues(): void
{
$previous = new Exception('Original 429');
$exception = new RateLimitException('Hubspot rate limit', 30, $previous);
$this->assertSame('Hubspot rate limit', $exception->getMessage());
$this->assertSame(30, $exception->getRetryAfter());
$this->assertSame($previous, $exception->getPrevious());
}
/**
* @return array<string, array{0: int, 1: int}>
*/
public static function retryAfterClampingProvider(): array
{
return [
'zero clamps to one' => [0, 1],
'negative clamps to one' => [-5, 1],
'minimum is one' => [1, 1],
'arbitrary value preserved' => [42, 42],
'large value preserved' => [86400, 86400],
];
}
#[DataProvider('retryAfterClampingProvider')]
public function testGetRetryAfterClampsToMinimumOfOne(int $input, int $expected): void
{
$exception = new RateLimitException('test', $input);
$this->assertSame($expected, $exception->getRetryAfter());
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – RateLimitExceptionTest.php
|
NULL
|
17070
|
|
17071
|
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
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Exceptions;
use Exception;
use Jiminny\Exceptions\RateLimitException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
#[CoversClass(RateLimitException::class)]
class RateLimitExceptionTest extends TestCase
{
public function testConstructorWithDefaults(): void
{
$exception = new RateLimitException();
$this->assertSame('', $exception->getMessage());
$this->assertSame(1, $exception->getRetryAfter());
$this->assertNull($exception->getPrevious());
}
public function testConstructorWithCustomValues(): void
{
$previous = new Exception('Original 429');
$exception = new RateLimitException('Hubspot rate limit', 30, $previous);
$this->assertSame('Hubspot rate limit', $exception->getMessage());
$this->assertSame(30, $exception->getRetryAfter());
$this->assertSame($previous, $exception->getPrevious());
}
/**
* @return array<string, array{0: int, 1: int}>
*/
public static function retryAfterClampingProvider(): array
{
return [
'zero clamps to one' => [0, 1],
'negative clamps to one' => [-5, 1],
'minimum is one' => [1, 1],
'arbitrary value preserved' => [42, 42],
'large value preserved' => [86400, 86400],
];
}
#[DataProvider('retryAfterClampingProvider')]
public function testGetRetryAfterClampsToMinimumOfOne(int $input, int $expected): void
{
$exception = new RateLimitException('test', $input);
$this->assertSame($expected, $exception->getRetryAfter());
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – RateLimitExceptionTest.php
|
NULL
|
17071
|
|
17072
|
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
RateLimitExceptionTest
Run 'RateLimitExceptionTest'
Debug 'RateLimitExceptionTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Exceptions;
use Exception;
use Jiminny\Exceptions\RateLimitException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
#[CoversClass(RateLimitException::class)]
class RateLimitExceptionTest extends TestCase
{
public function testConstructorWithDefaults(): void
{
$exception = new RateLimitException();
$this->assertSame('', $exception->getMessage());
$this->assertSame(1, $exception->getRetryAfter());
$this->assertNull($exception->getPrevious());
}
public function testConstructorWithCustomValues(): void
{
$previous = new Exception('Original 429');
$exception = new RateLimitException('Hubspot rate limit', 30, $previous);
$this->assertSame('Hubspot rate limit', $exception->getMessage());
$this->assertSame(30, $exception->getRetryAfter());
$this->assertSame($previous, $exception->getPrevious());
}
/**
* @return array<string, array{0: int, 1: int}>
*/
public static function retryAfterClampingProvider(): array
{
return [
'zero clamps to one' => [0, 1],
'negative clamps to one' => [-5, 1],
'minimum is one' => [1, 1],
'arbitrary value preserved' => [42, 42],
'large value preserved' => [86400, 86400],
];
}
#[DataProvider('retryAfterClampingProvider')]
public function testGetRetryAfterClampsToMinimumOfOne(int $input, int $expected): void
{
$exception = new RateLimitException('test', $input);
$this->assertSame($expected, $exception->getRetryAfter());
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – RateLimitExceptionTest.php
|
NULL
|
17072
|
|
17073
|
PhostormVIewINavicarecodeFV faVsco.js°9 JY-20725-h PhostormVIewINavicarecodeFV faVsco.js°9 JY-20725-handle-HS-search-rate-limiroledey© UserAutomatedReportsController.phpus ttt.is© PlaybackController.php© SyncRelatedActivityManager.php= oauth-private.key= oauth-public.key= storagesupervisord.pid@ text-relay.jsonv Otests› D Feature›> D Integration© HubspotSyncStrategyBase.php© JiminnyDebugCommand.php©› RateLimitExceptionTest.php X© HandleHubspotRateLimitTest.phd(C)MatchActivityCrmData.php© Job.php(C) CrmActivityService.phRateLimitException.pho© HandleHubspotRateLimit.php(C) Client.phpphpidehelper.php©) PaqinationState.phoC) MatchCrmData.php(C) CrmObiectsResolver.pho(C) ProviderRateLimiter.oho© PaginationConfia.ohn• U servicesC Unitk?php>J Actionsa componentdeclare(strict_types=1)ucontiquration[7 Consolenamesnace Tests Wnit Excentions:u ContractsDomain› use ...D DTOMEnums#[CoversClass(RateLimitException::class)]EventsD Exceptions> M7 Crml@ EmailActivitvimportEyc 2.class kareLimiccxceptlonlest excenas lescuasepublic function testConstructorWithDefaults0: void{...}HandlerTest.ohopublic function testConstructorWithCustomValues: void{...}(c) RateLimitExcentionTe‹Im fixturecGuardsHolnerc*dreturn array<string, arrayid: int, 1: intf>D Http_ IntegrationsD Interactionsiulnhenubuic static function retrvAfterclamoinaProvidero: arrav-...->@ Activity> • AiAutomation>[ Audiov @ AutomatedReports© CreateResultsTest.© RequestGenerateA:C RequestGenerateRC SendReportExpirincC SendReport JobTesC SendReportMailJobC SendReportNotGenSO MS#DataProviderretrvafterdlamoinaProvi.den"onublic function testGetRetrvAfterClamosToMinimum0f0neGint Sinnut. int Sexnected)• void!...}> M7 Calendan> M7 CrmM DealRisks> M Mailbo»v M Middlewarec HandleLubsnotRat) M Streamina> IM Toam• M TolenhanvTacts naccod• 7 (mon=laravel.logA SF (jiminny@localhost]4 HS_local (jiminny@localhost]# console [PKOb.A console [EU]# console [slAGiNg)[2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {"neaders".?"Uace":L"Inu,or May 2020 14.21.15 6Ml"Jn"concent-lvoe. "apolicacionison.charser=utt-on"Transter-Encod1nq":"chunked")."Connection": L"keep-aLive"J,"CF-Ray": ["9f80deb8db60dc3a-SOF"].patel imitExceptionTestHandleHubenotDatol imitTactv V Test Results40 l"suppont Dally • In ih oom100% Lz• Mon 11 May 13:02:37RateLimitExceptionTest vCascadeHubSpot Rate Limit Redocker exec docker lamp 1 redis-cli -h redis llen "queues: analytics low"docker exec docker_lamp_1 redis-cli-h redis zcard "queues:analytics low:delayed"#3. No log flood - count rate-limit lines per seconddocker exec docker_lamp_1 sh -c 'tail -n 5000 storage/logs/laravel.log | grep -c "Rate limit caught"# Expected: dozens per minute, not thousands per second# 4. No stack traces from MatchActivityCrmData::handle for rate limitslog 1 wc -1'+0 ..Dep -oE "attempts\": [0-9]÷" | sort | uniq -c'13 msJ 7 tests passed 7 tests total, 13 msdocker-compose:///Users/lukas/jiminny/infrastructure/dev/docker/docker-compose.yml]:lampA:php ./vendor/bin/phpunit --configuration phpunit.xml --filter TestsUnit ExceptionsTesting started at 13:02WARN(00001/Users/Lukas/jiminny/infrastructure/dev/docken/docker-compose.yml: the attribute 'version' is obsolete, it will be ignored, please remove it to avoid potential confusiPHPUnit 11.5.55 by Sebastian Bergmann and contributors.RuntimePHP 8.3.30contiquration: nome.mnnw/nhounsr..xmlTime: 00:00.072. Memory: 62.00 MBThere was 1 PHPUnit test runner warning:1) No code coverage driver availableOK, but there were issues!Tests: 1. Assertions:1, PHPUnit Warninas: 1Process Finiched with eyit code ?earch endpoints. tocus vour simulation on matchBvNameobs (these are the only Sentry-visible events)Ask anvthina (84L)+ « CodeClaude Qnus 4.7 Medium* Reiect alliiAccent alliW Windsurf Teams 1:1 UTF-8io 4 spaces...
|
PhpStorm
|
faVsco.js – RateLimitExceptionTest.php
|
NULL
|
17073
|
|
17074
|
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
RateLimitExceptionTest
Run 'RateLimitExceptionTest'
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp§ Support Daily • in 1h 58 mAPP (-zsh)83DOCKERO ₴1DEV (docker)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started₴82APP (-zsh)-zsh84What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ I-zsh885100% <78• Mon 11 May 13:02:381881screenpipe"O 86APP...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17074
|
|
17075
|
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
RateLimitExceptionTest
Run 'RateLimitExceptionTest'
Debug 'RateLimitExceptionTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17075
|
|
17076
|
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
RateLimitExceptionTest
Run 'RateLimitExceptionTest'
Debug 'RateLimitExceptionTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17076
|
|
17077
|
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
Rerun 'PHPUnit: HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
Stop 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17077
|
|
17078
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17078
|
|
17079
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17079
|
|
17080
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
Sync Changes
Hide This Notification
Code changed:
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17080
|
|
17081
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17081
|
|
17082
|
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
<?php
declare(strict_types=1);
namespace Tests\Unit\Jobs\Middleware;
use Exception;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Support\Facades\Log;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Jobs\Middleware\HandleHubspotRateLimit;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Tests\TestCase;
#[CoversClass(HandleHubspotRateLimit::class)]
class HandleHubspotRateLimitTest extends TestCase
{
private const int MAX_RETRY_DELAY = 600;
private const int MIN_RETRY_DELAY = 1;
private const int JITTER_SECONDS = 5;
private HandleHubspotRateLimit $middleware;
protected function setUp(): void
{
parent::setUp();
$this->middleware = new HandleHubspotRateLimit();
}
public function testPassesThroughWhenNoExceptionThrown(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$called = false;
$next = function (object $passed) use ($job, &$called): void {
$this->assertSame($job, $passed);
$called = true;
};
$this->middleware->handle($job, $next);
$this->assertTrue($called);
}
public function testPropagatesNonRateLimitExceptions(): void
{
$job = $this->createMock(Job::class);
$job->expects($this->never())->method('release');
$next = static function (): void {
throw new Exception('Database is down');
};
$this->expectException(Exception::class);
$this->expectExceptionMessage('Database is down');
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{retryAfter: int, expectedMin: int, expectedMax: int}>
*/
public static function delayClampingProvider(): array
{
return [
'short retry uses retry_after as floor' => [
'retryAfter' => 1,
'expectedMin' => self::MIN_RETRY_DELAY,
'expectedMax' => self::MIN_RETRY_DELAY + self::JITTER_SECONDS,
],
'medium retry passes through' => [
'retryAfter' => 30,
'expectedMin' => 30,
'expectedMax' => 30 + self::JITTER_SECONDS,
],
'large retry clamped to max' => [
'retryAfter' => 86400,
'expectedMin' => self::MAX_RETRY_DELAY,
'expectedMax' => self::MAX_RETRY_DELAY + self::JITTER_SECONDS,
],
];
}
#[DataProvider('delayClampingProvider')]
public function testReleasesJobWithClampedDelay(int $retryAfter, int $expectedMin, int $expectedMax): void
{
Log::shouldReceive('info')->zeroOrMoreTimes();
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn(1);
$job->expects($this->once())
->method('release')
->with($this->callback(static function (int $delay) use ($expectedMin, $expectedMax): bool {
return $delay >= $expectedMin && $delay <= $expectedMax;
}));
$next = static function () use ($retryAfter): void {
throw new RateLimitException('rate limited', $retryAfter);
};
$this->middleware->handle($job, $next);
}
/**
* @return array<string, array{attempts: int, shouldLog: bool}>
*/
public static function logSamplingProvider(): array
{
return [
'first attempt logs' => ['attempts' => 1, 'shouldLog' => true],
'second attempt logs' => ['attempts' => 2, 'shouldLog' => true],
'third attempt logs' => ['attempts' => 3, 'shouldLog' => true],
'fourth attempt skipped' => ['attempts' => 4, 'shouldLog' => false],
'ninth attempt skipped' => ['attempts' => 9, 'shouldLog' => false],
'tenth attempt logs (multiple of 10)' => ['attempts' => 10, 'shouldLog' => true],
'eleventh attempt skipped' => ['attempts' => 11, 'shouldLog' => false],
'twentieth attempt logs' => ['attempts' => 20, 'shouldLog' => true],
];
}
#[DataProvider('logSamplingProvider')]
public function testLogSampling(int $attempts, bool $shouldLog): void
{
if ($shouldLog) {
Log::shouldReceive('info')
->once()
->with(
'[HandleHubspotRateLimit] Rate limit caught, releasing job with delay',
$this->callback(static function (array $context) use ($attempts): bool {
return $context['attempts'] === $attempts
&& $context['retry_after'] === 1
&& isset($context['delay']);
})
);
} else {
Log::shouldReceive('info')->never();
}
/** @var Job&MockObject $job */
$job = $this->createMock(Job::class);
$job->method('attempts')->willReturn($attempts);
$job->expects($this->once())->method('release');
$next = static function (): void {
throw new RateLimitException('rate limited', 1);
};
$this->middleware->handle($job, $next);
}
}
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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – HandleHubspotRateLimitTest.php
|
NULL
|
17082
|
|
17083
|
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
120
5
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('team_id', $teamId)
->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...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17083
|
|
17084
|
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
120
5
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('team_id', $teamId)
->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 – JiminnyDebugCommand.php
|
NULL
|
17084
|
|
17085
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17085
|
|
17086
|
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
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp§ Support Daily • in 1h 58 mAPP (-zsh)83DOCKERO ₴1DEV (docker)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started₴82APP (-zsh)-zsh84What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ I-zsh885100% <78• Mon 11 May 13:02:57181screenpipe"O 86APP...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17086
|
|
17087
|
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:
PhostormINavicareCodeFV faVsco.js°9 JY-20725-handle-HS-search-rate-limroledeyc.IterateUserscommanac) PlavbackController.ongsynckelatedAcuvilymanager.pnpC) Jiminnycacheclearco) JiminnysettncryptedlC) Jiminny lokenintocomc) MakeslackLivecoachit© ManageScimForTeamC) MatchActivityCrmData.pho© Job.php(C) CrmActivityService.phRateLimitException.pho(C) HandleHubspotRateLimit.php(c) MarkBranchForEnvironC) Client.phpphpidehelper.php(C) MuteOrganizerchannec) PhoApm.php© PropagateCoachingFeC) Purgeconterences.ohgc) PurceSoi Deletedoodc) PuroesvncBatchescon(C) RecalculateDealRisksa(C) RemoveDeleteMarkers(C) RemoveUnusedPartici@ PesetFlasticSearch.nh@ PestoreActivitvCrmDrc 10(C) Roctore ActivitvTvnef(C) PunAiCallScorinaForlli(C) SoedActivities nhn(C) SendNudaeSyniration!© SyncActivity.php(e) Trackimoorted.onp© WhichWorkerlsWorkinsm Scheduling© Kernel.php> D Contracts> D Domain> ODTO> 0 Emails> C Enumsv D Eventsv M Activities> _ ActivitvProviden> M AiAutomation> MAudid> D Bots>D CoachingM Conferences70 DM Connections• M CrmC) ActivitvCancelled.nC) ActivitvCancelledA.C) Activitvl eadConver@ Activitvl inkodTocrC Activitvl oaaod nhn(e) ActivityCchoduledr© AutoLogActivity.phTacts naccod. 12 (maments addi©) PaqinationState.phoC) MatchCrmData.php(C) CrmObiectsResolver.pho© PaginationConfia.ohndeclare(strict_types=1);ico Canhon Canhon •use carbon carbonemmurableuco Tlluminatol Concolol Command.•use Illuminate\Support\Facades Redis:use Inval1dArqumenttxceptionJse Jiminny Jobs Automatedkeports kequestbenerateAskJ1minnykeportJob:Jse Jiminny Jobs Automatedkeporcs sendkeporthallJob:Jse Jiminny Jobs Crm Delete veritvactivityurmlaskJob:Jse Jiminny Jobs crm Matchactiv1tyurmbatause Jaminny Joos vobunspatcherintertace:use Jiminny Models Activity:use Jiminny Models AutomatedRevort.use Jiminny Models AutomatedRenortResult:use Jiminny Models Teamiuse Jiminny Models User:use iminnyRenositories AutomatedRenortsRenosi.torv:use Jiminny Services Activitv CrmownerResoveruse Jiminnv Services Kiosk AutomatedRenorts.AutomatedRenortsServi.ce:use Jiminnv Services UserP..lot UserPilotClient* Class JiminnyDebugCommand* @package Jiminny \Console\Commandsclass JiminnyDebugCommand extends Commandpublic const string FREQUENCY DAILY = 'daily':public const string FREQUENCY_WEEKLY = 'weekly':oubunc const strind FrEuuENcy Muninly = "monthly?public const string FREQUÊNChofoUepitERYyAccept File &~ X Reject File 4 * €helSupport Daily - in 1h 58 m100% Lz• Mon 11 May 13:02:57HandleHubspotRateLimitTest v+0 ..ACceрt KeneссRenect=custom.log~=laravel.logA SF (jiminny@localhost]4 HS_local [jiminny@localhost]Cascade# console [PKOb.# console leu)# console [slAGiNg)Hubspot Rate Limit Re[2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {"neaders".?"Uace":L"Inu,or May 2020 14.21.15 6Ml"Jndocker exec docker_lamp_1 redis-cli -h redis llen "queues:analytics_low"docker execdocker lamp1redis-cl1 h redis zcard "queues:analytics low: de layed""Transter-Encod1nq":"chunked")."Connection":"keep-alive""CF-Ray" : ["9f80deb8db60dc3a-SOF"],# 3. No log flood - count rate-limit lines per secondlocker exec docker_lamp_1 sh -c 'tail -n 5000 storage/logs/laravel. log | grep -c "Rate limit caught".dozens per minute, not chousands per second"Strict-Transport-Secur1ty":"max-aqe=31536008* 1ncLudeSubDomains: preload")n"Vary"*"orioin.*4. No stack traces from MatchActivitvCrmData::handle for rate Limitsdocker exec docker lamp 1 sh -c 'grep "Failed to match CRM data" storage/logs/laravel. log | wc -1* Expected: 6 durina a oure rate-umit storm. Non-zero only it real buas occur.accent-encodino""access-control-allow-credentials":["false"]."server-timing": ["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\",#5. Sampled logging - count Lines per attempts valuedocker exec docker_lamp_1 sh -c 'grep "Rate limit caught" storage/logs/laravel.log | grep -oE "attempts\": [0-9]+" | sort | uniq -c# Expected: high counts for 1, 2, 3, 10, 20, 30, 40 - zero or few for 4-9, 11-19, 21-29"x-hubspot-correlation-id":"019e02d0-6fd8-7812-bdba-885b7ccb3ee3"1."So+-Cookie"." c+hm-Stlirtd0aXVr.kSandas6hzVVKhzTn0BidvMaheCtmoV-1778163675-1.0.1Tuning the stormFor Postman to reliably triager 429s while vour iobs run07-May-26 14:51:15 GMT; domain=.hubapi.com; Http0nly; Secure; SameSite=None"],"Renont-To"."",• Postman concurrency: 5-10 parallel users hitting HubSpot-touching endpoints"endnoints".• Job count: 50-200 is enouah to see the steady state. 100k is overkill for verification"unl".httns:la.nel.cloudflane.com./renon+W/v42c=NVA1cVTPQfVm32anS0#xVF/sd2RN• Workers: 5-10. More workers = more visible thundering-herd-vs-cache dynamics• HubSpot test portal: ideally use a non-production portal with low traffic so you don't burn real quota.\"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"If Postman alone can't reliably trigger 429s (HubSpot's actual portal limits are higher than 5 RPS for non-search endpoints), focus your simulation on matchByName/search calls — those are bound at 5 RPS oer portal and will rate-limit fastest.SummaryFiles changed: JiminnyDebugCommand. php only. Three new private methods + handle() now picks one to run.To renlicate:1.Start workers"trace_10":C/AD8565-905t-4604-9405-0e5b551e55452. Run Postman load alongside3. php artisan jiminny:debug to fire the storm4. Tail logs + watch RedisHealthy sianature in loas:• Afew (Hubspot) Received 429 lines per cache TTL cvcle (not per second)[HandleHubspotRateLimit] Rate limit caught only on attempts 1, 2, 3, 10, 20..•Zero (MatchActvitvormbatal Farled to match CRM data stack traces during a oure rate-limit storm• After 20 min: (MatchActivitvGmbatal loh nermanentlv fafled after all retries for the leftover inhs (thece are the onlv Sentrv-vicible evente)e/Commands/m.JiminnvDebuaCommand.ohv +67-Ask anvthina (&4L)+ « CodeClaude Onus 4.7 Medium©al "View allReiect allAccent allWN Windsurf Toams 10-1UTF.8io 4 spaces...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17087
|
|
17088
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17088
|
|
17089
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17089
|
|
17090
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17090
|
|
17091
|
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
120
5
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('team_id', $teamId)
->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 – JiminnyDebugCommand.php
|
NULL
|
17091
|
|
17092
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17092
|
|
17093
|
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
120
5
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17093
|
|
17094
|
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
iTerm2ShellEditViewSessionScriptsProfilesWindowHelp$0.laolSupport Daily - in 1h 57 mAPP (-zsh)83DOCKER881DEV (docker)worker-analytics:worker-analytics_00: stoppedworker-crm-update:worker-crm-update_00: stoppedworker-download:worker-download_00: stoppedworker-nudges:worker-nudges_00:stoppedartisan-schedule:artisan-schedule_00:stoppedworker-emails:worker-emails_00: stoppedworker:worker_00: stoppedworker-calendar:worker-calendar_00:stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-conferences:worker-conferences_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: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: started₴82APP (-zsh)-zsh84What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image + docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20725-handle-HS-search-rate-limit) $ I-zsh885100% <78• Mon 11 May 13:03:11181screenpipe"0 ₴6APP...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17094
|
|
17095
|
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
PhpStormINavicarecodeFV faVsco.js°9 JY-20725-handle-HS-search-rate-lProiect vc.IterateUserscommanac) PlavbackController.ongsynckelatedAcuvilymanager.pnpC) Jiminnycacheclearco) Jiminnysettncryptedlc) MakeslackLivecoachitC) MatchActivityCrmData.pho© Job.php(c) CrmActivityService.ohgRateLimitException.pho(C) HandleHubspotRateLimit.php(c) MarkBranchForEnviron(C) CrmObiectsResolver.pho(C) MuteOrganizerchanne(C) PacinationConfia.ohoc) PhoApm.phpcllass Jminnviehuacommand extends Commandl(C) RemoveDeleteMarkers z4d© RemoveExpiredNudge: 376(C) RemoveUnusedPartici© ResetElasticSearch.ph 371(C) RestoreActivityCrmPre 372© RestoreActivityTypeC( 373© RunAiCallScoringForUr 374(C) SoedActivities nhn© SendNudgeExpirationV 376© SyncActivity.php(e) Trackimoorted.onpc) WhichWorkerlsWorkint 379Scheduling© Kernel.php> D Contracts> D Domain> ODTO> 0 Emails> C Enumsv D Eventsv M Activities> _ ActivitvProvidenM AiAutomation> AudidD BotsD CoachingMConferencesM Connections• M CrmC) ActivitvCancelled.n zoz© ActivityCancelledA: 397(C) Activitvl eadConvet zod@ActivityLinkedToCri 395C Activitvl oaaod nhn 1od© ActivityScheduled.r z0л© AutoLogActivity.phi 402private function rateLimitoScrmService->syncOpportunity('374720564');ScrmService->matchByName('Robot'):ACcept Renectprivate function simulateMatchActivityStorm(int SteamId = 2, int $count = 100): voidlsteam= leam:.tindsteamla*Sconfia = Steam->qetCrmConfiqurationOSactivities = Activity::quervo->where co'team id'. SteamId)->aet 01$this->info( string: "Dispatching {Sactivities->count} MatchActivityCrmData jobs (portal={$config->getld,.foreach (Sactivities as $activity) 1MatchActivitvCrmData:disoatchdarguments: Sactivity->getId, Sconfig, true):Sthic-sinfor 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::queryOswbonot column.'team id'. $teamId)->whererornulu columns.'crm provider id')andion"unloesmstesaltt->aetor"Sactavitres->countOr VerifvActzvitvcrmlaskJo 7o0s")*hlsuppont Dally • In 1h o/m100% Lz• Mon 11 May 13:03:11HandleHubspotRateLimitTest v+0 ..=laravel.logA SF (jiminny@localhost]4 HS_local (jiminny@localhost]# console [PKob.# console leu)# console [slAGiNg)[2026-05-07 14:21:15] local.INF0: [Hubspot] DEBUG Getting headers {W19лV"neaders".?"Uace":L"Inu,or May 2020 14.21.15 6Ml"Jn"concenc-lyoe. apolicacionison.charser=utt-on"Transter-Encod1nq":"chunked")."Connection":"keep-alive""CF-Ray" : ["9f80deb8db60dc3a-SOF"],"Strict-Transport-Secur1ty":"max-aqe=31536008* 1ncLudeSubDomains: preload")naccent-encodino""access-control-allow-credentials": ["false"]."server-timing": ["hcid;desc=\"019e02d0-6fd8-7812-bdba-885b7ccb3ee3\","x-hubspot-correlation-id":["019e02d0-6fd8-7812-bdba-885b7ccb3ee3"],"So+-Cookie"." c+hm-Stlirtd0aXVr.kSandas6hzVVKhzTn0BidvMaheCtmoV-1778163675-1.0.107-May-26 14:51:15 GMT; domain=.hubapi.com; Http0nly; Secure; SameSite=None"],"Renont-To"."","endnoints"."unl".httns:la.nel.cloudflane.com./renon+W/v42c=NVA1cVTPQfVm32anS0#xVF/sd2RN\"group)":\"cf-nel\","max_age\":604800}"],"NEL":["{\"success_fraction\":0.01,reportto. "cr-nel,"max age":604800}"]"Server": ["cloudflare"]}} {"correlation_1d":"95256555-ec78-4541-b9za-adta/Sb6Yeab"."trace_10":C/AD8565-905t-4604-9405-0e5b551e5545CascadeHubspot Rate Limit Redocker exec docker_lamp_1 redis-cli -h redis llen "queues:analytics_low"docker execdocker lamp1redis-cl1 h redis zcard "queues:analytics low: de layed"# 3. No log flood - count rate-limit lines per secondlocker exec docker_lamp_1 sh -c 'tail -n 5000 storage/logs/laravel. log | grep -c "Rate limit caught".dozens per minute, not chousands per second*4. No stack traces from MatchActivitvCrmData:chandle for rate Limitsdocker exec docker lamp 1 sh -c 'grep "Failed to match CRM data" storage/logs/laravel. log | wc -l# Expected: 0 during a pure rate-limit storm. Non-zero onlv if real buas occur.#5. Sampled logging - count lines per attempts valuedocker exec docker_lamp_1 sh -c 'grep "Rate limit caught" storage/logs/laravel.log | grep -oE "attempts\": [0-9]+" | sort | uniq -c# Expected: high counts for 1, 2, 3, 10, 20, 30, 40 - zero or few for 4-9, 11-19, 21-29Tuning the stormFor Postman to reliably triager 429s while vour iobs run• Postman concurrency: 5-10 parallel users hitting HubSpot-touching endpoints• Job count: 50-200 is enouah to see the steady state. 100k is overkill for verification• Workers: 5-10. More workers = more visible thundering-herd-vs-cache dynamics• HubSpot test portal: ideally use a non-production portal with low traffic so you don't burn real quota.If Postman alone can't reliably trigger 429s (HubSpot's actual portal limits are higher than 5 RPS for non-search endpoints), focus your simulation on matchByName/search calls — those are bound at 5 RPS per portal and willl rate-limit fastest.SummaryFiles changed: JiminnyDebugCommand. php only. Three new private methods + handle() now picks one to run.To renlicate:1.Start workers2. Run Postman load alongside3. php artisan jiminny:debug to fire the storm4. Tail logs + watch RedisHealthy sianature in loas:• Afew (Hubspot) Received 429 lines per cache TTL cvcle (not per second)[HandleHubspotRateLimit) Rate Limit caught only on attempts 1, 2, 3, 10, 20...•Zero (MatchActvitvormbatal Farled to match CRM data stack traces during a oure rate-limit storm• After 20 min: (MatchActivitvGmbatal loh nermanentlv fafled after all retries for the leftover inhs (thece are the onlv Sentrv-vicible evente)e/Commands/m.JiminnvDebuaCommand.0hv +5%Ask anvthina (&4L)+ « CodeClaude Onus 4.7 MediumReiect allWN Windsurf Toams 271-80UTF.8©al "View allAccent alliio 4 spaces...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17095
|
|
17096
|
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17096
|
|
17097
|
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17097
|
|
17098
|
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17098
|
|
17099
|
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('team_id', $teamId)
->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"}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – JiminnyDebugCommand.php
|
NULL
|
17099
|